This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Pad string to right | |
| String.prototype.pad=function(len,str){ | |
| if(typeof str=="undefined") str=" "; | |
| if(this.length>len) return this.toString(); | |
| str=str.repeat(len-this.length); | |
| return (this+str).substr(0,len); | |
| } | |
| // Pad string to left | |
| String.prototype.lpad=function(len,str){ | |
| if(typeof str=="undefined") str=" "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // 回転するやつ /-\| | |
| $c=['|','/','-','\\']; | |
| // like GCP | |
| //$c=['⣤','⣆','⡇','⠏','⠛','⠹','⢸','⣰']; | |
| $ci = count($c); | |
| for($i=0;$i<=100;$i++){ | |
| echo "\r"; // 描画カーソルを行頭に戻す | |
| $block=str_repeat('#',floor($i/5)); | |
| printf('Processing... %s [%-20s]%3d%%', $c[$i%$ci], $block, $i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Pad string to right | |
| String.prototype.pad=function(len,str){ | |
| if(typeof str=="undefined") str=" "; | |
| if(this.length>len) return this.toString(); | |
| str=str.repeat(len-this.length); | |
| return (this+str).substr(0,len); | |
| } | |
| // Pad string to left | |
| String.prototype.lpad=function(len,str){ | |
| if(typeof str=="undefined") str=" "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 池袋 | |
| 大塚 | |
| 巣鴨 | |
| 駒込 | |
| 田端 | |
| 日暮 | |
| 上野 | |
| 秋葉 | |
| 神田 | |
| 東京 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #sudo docker exec -it gitlab /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -U gitlab -d gitlabhq_production | |
| sudo docker exec -it gitlab sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d gitlabhq_production | |
| psql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * 前方一致 | |
| * $haystackが$needleから始まるか判定します。 | |
| * @param string $haystack | |
| * @param string $needle | |
| * @return boolean | |
| */ | |
| function startsWith($haystack, $needle) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006"> | |
| <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> | |
| <Account> | |
| <AccountType>email</AccountType> | |
| <Action>settings</Action> | |
| <Protocol> | |
| <Type>IMAP</Type> | |
| <Server>imap.gmail.com</Server> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl http2; | |
| server_name example.com; | |
| error_log /var/log/nginx/error.log; | |
| access_log /var/log/nginx/access.log main; | |
| root /var/www/example.com/public; | |
| index index.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssl_session_cache shared:SSL:10m; | |
| ssl_session_timeout 10m; | |
| ssl_dhparam dhparam.pem; | |
| add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; | |
| add_header X-Frame-Options DENY; | |
| add_header X-Content-Type-Options nosniff; | |
| add_header Cache-Control "public, must-revalidate"; | |
| ## TLS Session Tickets setting | |
| ssl_session_tickets off; # Requires nginx >= 1.5.9 | |
| ssl_session_ticket_key ssl_session_ticket.key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keyword = /(?:正規表現|頑張(?:って|る)|書(?:いてみよ|こ)う)/ | |
| var device = '<user@example.com>'; | |
| var screen_name = 'your_screen_name'; | |
| var PushBullet = require('pushbullet'); | |
| var pusher = new PushBullet('PUSH_BULLET_API_KEY'); | |
| var twitter = require('ntwitter'); | |
| var twit = new twitter({ | |
| consumer_key: 'YOUR_CONSUMER_KEY', | |
| consumer_secret: 'YOUR_CONSUMER_SECRET', | |
| access_token_key: 'ACCESS_TOKEN_KEY', |