<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[april breeze]]></title><description><![CDATA[another web programmer]]></description><link>http://aprilbriz.com/</link><generator>Ghost 0.5</generator><lastBuildDate>Tue, 20 Apr 2021 23:42:40 GMT</lastBuildDate><atom:link href="http://aprilbriz.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[react-dates ES Module build for webpack Tree Shaking]]></title><description><![CDATA[<p><code>import { DateRangePicker } from 'react-dates';</code></p>

<p>일반적인 import 방식. webpack bundle에 react-dates 전부 다 포함됨.</p>

<p><code>import DateRangePicker from 'react-dates/lib/components/DateRangePicker';</code></p>

<p>이렇게 하면 실제 사용할 컴포넌트만 불러오므로 용량이 줄어듦. 약간.</p>

<p><code>import DateRangePicker from 'react-dates/esm/components/DateRangePicker';</code></p>

<p>그런데, 이렇게 /lib/를 /esm/으로 바꾸면 용량이 약간 더 줄어듦.</p>

<p>/lib/는 CommonJS build이고, /esm/은 ES Module build라서 webpack의 tree-shaking이 적용됨. 물론 UglifyJSPlugin을 사용해야함.</p>

<p><a href="https://github.com/airbnb/react-dates/pull/791">https://github.com/airbnb/react-dates/pull/791</a></p>

<p><a href="https://webpack.js.org/guides/tree-shaking/">https://webpack.js.org/guides/tree-shaking/</a></p>]]></description><link>http://aprilbriz.com/react-dates-es-module-build-for-webpack-tree-shaking/</link><guid isPermaLink="false">7441a652-5e3b-464b-aa0e-b66f9c3108f0</guid><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Fri, 12 Jan 2018 12:17:05 GMT</pubDate></item><item><title><![CDATA[Webkit based Browser Bug: The caption at  the top of table moves to bottom]]></title><description><![CDATA[<p>Safari(Mac, iOS), Chrome(iOS)에서 확인했고, <br>
caption 태그가 있는 table 태그 안에서 display hide/show 되는 element가 있으면 caption이 멋대로 위아래로 움직이는 현상이 발생함.</p>

<p>검색해봐도 아래 내용 정도 뿐이고, 답변도 없음;</p>

<p><a href="https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom">https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom</a></p>

<p>CSS caption-side 는 아무 소용이 없고, table 안에서 display hide/show를 하지 않는 방법 밖엔 없는 것 같음.</p>

<p>제 경우 td 안의 button 태그에 특정 class가 붙을때만 <strong>:before</strong> pseudo-element 에 <strong>content:</strong> 를 사용하고 있었는데 button 태그에 디폴트로 <strong>content: "";</strong> 을 넣어줬더니 해결됐음. 하... 머 이런... ㅎ</p>]]></description><link>http://aprilbriz.com/webkit-based-browser-bug-the-caption-at-the-top-of-table-moves-to-bottom/</link><guid isPermaLink="false">640dfb18-8a8c-482b-9b41-a54f28519404</guid><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Fri, 18 Aug 2017 07:21:12 GMT</pubDate></item><item><title><![CDATA[React - ref callback]]></title><description><![CDATA[<p><a href="https://facebook.github.io/react/docs/refs-and-the-dom.html">React Docs - Refs and the DOM</a></p>

<blockquote>
  <p>If the ref callback is defined as an <strong>inline function</strong>, it will get <strong>called twice during updates</strong>, <strong>first with null</strong> and then again with the DOM element. This is because a new instance of the function is created with each render, so React needs to clear the old ref and set up the new one. <strong>You can avoid this by defining the ref callback as a bound method on the class</strong>, but note that <em>it shouldn't matter in most cases</em>.</p>
</blockquote>

<p>그러니까, render()안에서,</p>

<p><code>&lt;div ref={(ref) =&gt; { this.ref = ref; }}&gt;</code> </p>

<p>이렇게 하면, 처음 render() 할때는 한 번만 실행되고, 두번째 render() 부터는 두 번 실행됨.</p>

<p>그리고,</p>

<p><code>&lt;div ref={this.refCallback}&gt;</code></p>

<p>이렇게 하면 처음 render() 될때 딱 한 번만 실행됨.</p>]]></description><link>http://aprilbriz.com/react-ref-callback/</link><guid isPermaLink="false">e3588a39-8568-477a-b1ec-0341ffbbf5ea</guid><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Wed, 18 Jan 2017 05:26:05 GMT</pubDate></item><item><title><![CDATA[Fix "WooCommerce Email Verification" plugin]]></title><description><![CDATA[<p>WooCommerce 회원가입을 이용하면 Wordpress에서 기본으로 제공하는 이메일 인증 기능을 사용할 수가 없다. <br>
검색해보니 <a href="https://wordpress.org/plugins/woocommerce-email-verification/">WooCommerce Email Verification</a> 플러그인이 나왔고, 작동은 하는데 처음 안내 메시지가 화면에 나오질 않고 있어서 코드 뒤져보다가 해결책 찾음...</p>

<p>플러그인은 안내 메시지를 세션에 넣어두고 템플릿에서 <code>wc_print_notices()</code>를 통해 보여주고 있는데 가입 인증 메일 발송 후 페이지가 리다이렉션 되면서 세션이 새로 만들어져서 메시지가 사라져 버리고 있었다.</p>

<p>플러그인 최근 업데이트가 2014-11-24인걸로 봐서 WooCommerce Session 방식이 그 후에 바꼈을 수도...</p>

<p>아무튼,
includes/class-wev-email-verification.php 파일의 156번째줄 <code>wc_add_notice(</code> 위에 <code>WC()-&gt;session-&gt;set_customer_session_cookie(true);</code> 추가해주면 해결된다.</p>

<p><code>set_customer_session_cookie()</code>는 비회원이 장바구니에 상품을 담았을때 세션 유지되도록 쿠키를 구워주는 역할을 함.</p>

<p>흐어... 이거땜시 몇시간 날렸네...</p>]]></description><link>http://aprilbriz.com/fix-woocommerce-email-verification-plugin/</link><guid isPermaLink="false">f809fc3c-f961-491b-b239-ad1913a0f8ce</guid><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Sun, 15 Mar 2015 15:05:24 GMT</pubDate></item><item><title><![CDATA[table row mover - jQuery plugin]]></title><description><![CDATA[<p><a href="https://github.com/springBriz/table-row-mover">https://github.com/springBriz/table-row-mover</a></p>

<p>DEMO : <a href="http://springbriz.github.io/table-row-mover/demo/initializr_bootstrap/">http://springbriz.github.io/table-row-mover/demo/initializr_bootstrap/</a></p>]]></description><link>http://aprilbriz.com/table-row-mover-jquery-plugin/</link><guid isPermaLink="false">8a22a15e-032e-4fc4-93af-7ce142e37ded</guid><category><![CDATA[jquery]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Sat, 28 Feb 2015 10:09:51 GMT</pubDate></item><item><title><![CDATA[Vagrant - HHVM Hack Nginx Laravel]]></title><description><![CDATA[<p><a href="https://github.com/springBriz/vhhnl">https://github.com/springBriz/vhhnl</a> <br>
(forked from <a href="https://github.com/kernelcurry/vhhnl">https://github.com/kernelcurry/vhhnl</a>)</p>

<p>원 소스의 Vagrantfile, install.sh로 설치했더니 몇가지 문제 발생.</p>

<ul>
<li>Nginx 설치할때 "There are problems and -y was used without --force-yes" 에러남</li>
<li>Nginx repository가 Nginx 사이트의 최근 문서가 아닌 예전 Wiki 기준으로 돼있음</li>
<li>composer 설치 안됨 (php가 아닌 hhvm이라서 SlowTimer 이슈 생김)</li>
</ul>

<p>그래서, fork 한 후 Nginx repository, apt key 등 바꾸고, Nginx 설정 관련 부분 수정하고, composer 다운로드 및 설치 방법 변경 후 alias 추가까지.</p>]]></description><link>http://aprilbriz.com/vagrant-hhvm-hack-nginx-laravel/</link><guid isPermaLink="false">726c2543-74cc-40db-a19b-32130ca4e0cf</guid><category><![CDATA[HHVM]]></category><category><![CDATA[Laravel]]></category><category><![CDATA[Nginx]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Wed, 16 Apr 2014 01:52:08 GMT</pubDate></item><item><title><![CDATA[[Ghost] Setting up Sendmail]]></title><description><![CDATA[<p>like this:  </p>

<pre><code class="prettycode">        mail: {
            transport: 'sendmail',
            options: {
                path: '/path/to/sendmail',
                args: ['-t', '-f', 'sender@email.com']
            }
        },
</code></pre>

<p><a href="https://github.com/andris9/Nodemailer#setting-up-sendmail">https://github.com/andris9/Nodemailer#setting-up-sendmail</a></p>]]></description><link>http://aprilbriz.com/ghost-setting-up-sendmail/</link><guid isPermaLink="false">b6965a07-d220-41e1-ae96-ad936e4d4356</guid><category><![CDATA[Ghost]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 18 Mar 2014 08:48:51 GMT</pubDate></item><item><title><![CDATA[Fix a bug in Ubuntu Official Documentation > Backups > Archive Rotation]]></title><description><![CDATA[<p>문제가 생기는건 8일 또는 9일이 토요일일때만.</p>

<p><a href="https://help.ubuntu.com/12.04/serverguide/backups-shellscripts-rotation.html">https://help.ubuntu.com/12.04/serverguide/backups-shellscripts-rotation.html</a></p>

<p>위 링크의 스크립트에서 <strong>day_num=$(date +%d)</strong> 이렇게 날짜를 뽑아오면 한자리수 날자일때 leading zero가 포함된 string을 반환한다.</p>

<p>이 상태로 그 아래의 if문을 통과하면 <strong>value too great for base</strong> 에러가 발생하고, 뒷 부분에서 archive_file 변수에 값을 할당하지 못해서 백업을 생성하지 못하게 된다. 위에 쓴 것처럼 8일 또는 9일이 토요일일때만.</p>

<p>그래서, day_num을 integer로 typecasting 하거나 0을 없애야한다. 아래처럼.</p>

<p><strong>day_num=$(expr $day_num + 0)</strong>
or <br>
<strong>day_num=(${day_num#0})</strong></p>]]></description><link>http://aprilbriz.com/fix-a-bug-in-ubuntu-official-documentation-backups-archive-rotation/</link><guid isPermaLink="false">fe73755f-c61e-4936-8945-57cc4eeaec6b</guid><category><![CDATA[Ubuntu]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 11 Mar 2014 08:35:46 GMT</pubDate></item><item><title><![CDATA[localhost in MySQL]]></title><description><![CDATA[<p>MySQL에서 localhost는 socket file을 이용한 연결을 의미함. TCP/IP 안씀. <br>
그래서, skip-name-resolve 옵션 사용한 경우, host가 localhost로 지정된 user는 127.0.0.1로 접속이 안됨.
그리고, local에서만 접속하는 경우 skip-networking 사용하면 TCP/IP 연결을 아예 사용하지 않음.</p>

<p><a href="http://dev.mysql.com/doc/refman/5.5/en/connecting.html">http://dev.mysql.com/doc/refman/5.5/en/connecting.html</a></p>

<blockquote>
  <p>On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs. For connections to localhost, MySQL programs attempt to connect to the local server by using a Unix socket file.</p>
</blockquote>]]></description><link>http://aprilbriz.com/localhost-in-mysql/</link><guid isPermaLink="false">35a30f07-8bcb-4e83-98de-9096086f8582</guid><category><![CDATA[MySQL]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 11 Mar 2014 08:31:45 GMT</pubDate></item><item><title><![CDATA[[Apache] logging images with external referrer]]></title><description><![CDATA[<pre><code class="prettyprint lang-bash">&lt;IfModule mod_setenvif.c&gt;  
    SetEnvIfNoCase Request_URI "\.jpg$" no-log env-image
    SetEnvIfNoCase Request_URI "\.jpeg$" no-log env-image
    SetEnvIfNoCase Request_URI "\.gif$" no-log env-image
    SetEnvIfNoCase Request_URI "\.png$" no-log env-image
&lt;/IfModule&gt;

&lt;VirtualHost *:80&gt;  
    DocumentRoot /path-to-document-root
    ServerName www.example.com

    ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
    CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined env=!no-log

    &lt;IfModule mod_setenvif.c&gt;
        SetEnvIfNoCase Referer (.+\.)?example\.com not-logging-image-referer=1
        SetEnvIfNoCase Referer ^$ not-logging-image-referer=1
        SetEnvIf not-logging-image-referer 1 !env-image
    &lt;/IfModule&gt;
    CustomLog ${APACHE_LOG_DIR}/example.com-image-referer.log combined env=env-image
&lt;/VirtualHost&gt;  
</code></pre>

<ol>
<li>access log - not logging images  </li>
<li>another log - logging images with external referrer <br>
(emulate logical AND : <a href="http://stephane.lesimple.fr/blog/2010-01-28/apache-logical-or-and-conditions-with-setenvif.html">http://stephane.lesimple.fr/blog/2010-01-28/apache-logical-or-and-conditions-with-setenvif.html</a> )</li>
</ol>

<p>... 다 만들어놓고 보니 static file은 Nginx에서 처리하게 해놨던게 생각나서.. 쓸모없어짐-_-...</p>]]></description><link>http://aprilbriz.com/apache-logging-images-with-external-referrer/</link><guid isPermaLink="false">e6489959-6232-4435-bb9a-20fd19e815f1</guid><category><![CDATA[Apache]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 11 Mar 2014 08:29:30 GMT</pubDate></item><item><title><![CDATA[NGINX + HHVM (FastCGI) + Laravel]]></title><description><![CDATA[<p>설치 등등은 <a href="http://fideloper.com/hhvm-nginx-laravel">http://fideloper.com/hhvm-nginx-laravel</a> 여기 잘 정리돼있고,
위 링크의 nginx 설정에는 /index.php?q=$uri&amp;$args 로 넘기도록 돼있는데 q= 으로 넘기는 방식이 왠지 맘에 안들어서 아래처럼 수정했음.</p>

<pre><code class="prettyprint lang-bash">server {  
    root /path/to/document/root;
    index index.html index.php;

    server_name site.com *.site.com;

    location / {
        # from Laravel .htaccess
        # https://github.com/laravel/laravel/commit/ce64714b2fda6d6a14ea6649a03aa59bfbd6d079
        rewrite ^/(.*)/$ /$1 redirect;

        try_files $uri @proxy;
    }

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|svg|swf)$ {
        access_log  off;
    }

    # hhvm.conf
    location ~ \.php$ {
        try_files $uri @proxy;
        fastcgi_keep_conn on;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location @proxy {
        fastcgi_keep_conn on;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root/index.php;
        include        fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
</code></pre>]]></description><link>http://aprilbriz.com/nginx-hhvm-fastcgi-laravel/</link><guid isPermaLink="false">731af13e-75ce-471b-9b2e-738da75f3ba1</guid><category><![CDATA[HHVM]]></category><category><![CDATA[Laravel]]></category><category><![CDATA[Nginx]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 11 Mar 2014 08:26:05 GMT</pubDate></item><item><title><![CDATA[how to use PHP 5.3.x or 5.4.x in MAMP]]></title><description><![CDATA[<ol>
<li>install MAMP (v2.2)  </li>
<li>open MAMP Pro  </li>
<li>rename /Applications/MAMP/bin/php/php5.2.17 to something else  </li>
<li>ln -s /Applications/MAMP/bin/php/php5.3.27 /Applications/MAMP/bin/php/php5.2.17  </li>
<li>open MAMP and select PHP 5.2.17  </li>
<li>done</li>
</ol>]]></description><link>http://aprilbriz.com/how-to-use-php-5-3-x-or-5-4-x-in-mamp/</link><guid isPermaLink="false">0ac2d4f3-ab36-4de1-8ff9-27141d593c12</guid><category><![CDATA[MAMP]]></category><dc:creator><![CDATA[breeze]]></dc:creator><pubDate>Tue, 11 Mar 2014 08:08:00 GMT</pubDate></item></channel></rss>