| 作: | @voluntas |
|---|---|
| バージョン: | 1.0.1 |
| URL: | https://voluntas.github.io/ |
2015 年 1 月 12 日に行われた 「テレビ連動サーバー」勉強会 向けの発表資料です。
| String.prototype.before = function(word, include){ | |
| var idx = this.indexOf(word) | |
| var l = include ? word.length : 0 | |
| return idx >= 0 ? | |
| this.substr(0, idx + l) : | |
| "" | |
| } | |
| String.prototype.after = function(word, include){ | |
| var idx = this.indexOf(word) | |
| var l = include ? 0 : word.length |
| 作: | @voluntas |
|---|---|
| バージョン: | 1.0.1 |
| URL: | https://voluntas.github.io/ |
2015 年 1 月 12 日に行われた 「テレビ連動サーバー」勉強会 向けの発表資料です。
| ?php | |
| function SendAttachedMail( $from , $to , $subject , $body , &$file ){ | |
| mb_language( 'ja' ); |
| <?php | |
| function mb_wordwrap($string, $width=75, $break="\n", $cut = false) { | |
| if (!$cut) { | |
| $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.',}\b#U'; | |
| } else { | |
| $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.'}#'; | |
| } | |
| $string_length = mb_strlen($string,'UTF-8'); | |
| $cut_length = ceil($string_length / $width); | |
| $i = 1; |
| You can add this entry in your /etc/hosts file: | |
| 127.0.0.1 www.sublimetext.com |
| <VirtualHost *:80> | |
| ServerAdmin ○○○○@○○○○.○○○ | |
| ServerName ○○○○.○○○ | |
| ServerAlias *.○○○○.○○○ | |
| VirtualDocumentRoot /home/webroot/%1/htdocs/ | |
| ErrorLog logs/○○○○.○○○-error_log | |
| CustomLog logs/○○○○.○○○-access_log common | |
| </VirtualHost> |
| ProxyRequests Off | |
| ProxyPreserveHost On | |
| <Proxy *> | |
| Order deny,allow | |
| Allow from all | |
| </Proxy> | |
| ProxyPass /EMBackend http://localhost:8080/backend/mvc | |
| ProxyPassReverse /EMBackend http://localhost:8080/backend/mvc |
| Lsyncdが利用している inotifyが監視できるファイル数には上限があります。 | |
| この上限を超えると、Lsyncdは動作を停止 or 起動してくれません。 | |
| 起動しようとすると、こんなエラーが発生します。(しました) | |
| lsyncd: Error, Terminating since out of inotify watches.#012Consider increasing /proc/sys/fs/inotify/max_user_watches | |
| ちなみに、上限値は以下で確認できます。 |
| さて前回jQueryをダウンロードしましたが、今回は実際にjQueryを使う際に必要になる基本セレクタについてを勉強します。 | |
| まずセレクタとは何なのかを簡単に説明します。 | |
| 下記のようなHTMLがあったとします。 | |
| <html> | |
| <head> | |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
| <title>jQueryを使ってみよう。(基本編 セレクタ1)</title> | |
| <script type="text/javascript" src="../jquery-1.2.6.min.js"></script> |
| $(".sparkline.pie_week").sparkline([1, 1, 2], { | |
| type: 'pie', | |
| width: '400', | |
| height: '400', | |
| enableTagOptions: true, | |
| tooltipFormat: '<span style="color: {{color}}">●</span> {{offset:names}} ({{percent.1}}%)', | |
| tooltipValueLookups: { | |
| names: { | |
| 0: 'one', | |
| 1: 'two', |