Go 1.4 RC1が出たのでまとめ
原文: http://tip.golang.org/doc/go1.4
- ガベージコレクタを改善したよ
goコマンドにいくつかツールが追加されたよ- Android, NaCl, AMD64上のPlan9サポートが追加されたよ。互換性も維持するよ
| (function(global) { | |
| 'use strict'; | |
| function Ellipsis(element, trail) { | |
| this.element = element; | |
| this.exactHeight = element.offsetHeight; | |
| this.text = element.textContent; | |
| this.textSize = this.text.length; | |
| this.trail = trail || '...'; | |
| } |
Go 1.4 RC1が出たのでまとめ
原文: http://tip.golang.org/doc/go1.4
go コマンドにいくつかツールが追加されたよ| #!/bin/sh | |
| # http://qiita.com/takashisite/items/0eeb45c8bbd232e915dd | |
| ffmpeg -i movie.mp4 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }' |
| <?php | |
| /** | |
| * Qdmail ver 1.2.6b | |
| * E-Mail for multibyte charset | |
| * | |
| * PHP versions 4 and 5 (PHP4.3 upper) | |
| * | |
| * Copyright 2008, Spok in japan , tokyo | |
| * hal456.net/qdmail : http://hal456.net/qdmail/ | |
| * & CPA-LAB/Technical : http://www.cpa-lab.com/tech/ |
| #!/bin/bash | |
| YOU=`whoami` | |
| CWD=$(cd $(dirname $0);pwd) | |
| # Create mout storage directory if not exists | |
| if [ ! -d "$HOME/perfstore/graphite" ]; then | |
| echo "creating directory: $HOME/perfstore/graphite..." | |
| mkdir -p $HOME/perfstore/graphite | |
| fi |
| <?php | |
| class GetZoneInfo { | |
| const ORIGIN_SIGNATURE = '$ORIGIN'; | |
| const IN_SIGNATURE = 'IN'; | |
| const A_RECORD = "A"; | |
| const CNAME_RECORD = "CNAME"; | |
| protected $fqdnList = []; |
| #!/bin/sh | |
| # Artisan ( Laravel's CLI tool ) find-up, selectable runner | |
| # @depend | |
| # peco - https://github.com/peco/peco | |
| PHP=`which php` | |
| CWD=`pwd` | |
| ARTISAN="artisan" | |
| COMMAND= |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| #!/bin/bash | |
| # This is bash-completion for 'npm run' command. | |
| # Find up package.json and completion 'npm scripts'. | |
| _npm_run_completion() { | |
| CURRENT="${COMP_WORDS[COMP_CWORD]}" | |
| SUBCOMMAND="${COMP_WORDS[COMP_CWORD-1]}" | |
| if [ "${SUBCOMMAND}" != "run" ]; then | |
| return | |
| fi |
| #!/bin/bash | |
| set -eu | |
| atexit() { | |
| [[ -n $tmpdir ]] && rm -fr "$tmpdir" | |
| [[ -n $sslconf ]] && rm -fr "$sslconf" | |
| } | |
| tmpdir=`mktemp -d` | |
| sslconf=`mktemp` | |
| trap atexit EXIT | |
| trap 'trap - EXIT; atexit; exit -1' SIGHUP SIGINT SIGTERM |