This file contains 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
;sample_destructive_methods | |
; | |
;名前に「!」が付いているメソッドは破壊的メソッド | |
#module destm a, b | |
#modfunc 更新! int x, int y | |
a = x | |
b = y | |
return | |
#modfunc 表示 |
This file contains 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
import glob | |
if __name__ == '__main__': | |
paths = glob.glob('./*/data/*.csv') | |
cnt = 0 | |
for path in paths: | |
with open(path, 'r') as f: | |
cnt += reduce(lambda x,y: x+1, f, 0) | |
print cnt |
This file contains 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
/** | |
* @name 千反田える.js | |
* @author s_hiiragi | |
* @created_date 2012/11/07 02:13 | |
*/ | |
/* Usage: | |
* | |
* node 千反田える.js {options} | |
* |
This file contains 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
console.log( 'クラスベースオブジェクト指向 on JavaScript' ); | |
console.group( 'Functionを使う方法' ); | |
(function() { | |
console.group( '(1) A, B, Cクラス兼コンストラクタとクラスメソッドを定義' ); | |
console.log( 'CはBを継承, BはAを継承する' ); | |
function A() { /* 初期化処理 */ } | |
A.intro = function() { console.log('A'); }; |
This file contains 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
# @name get_termsize.rb | |
# @desc 端末のサイズ(列数,行数)を取得 | |
=begin | |
man | |
http://linuxjm.sourceforge.jp/html/LDP_man-pages/man4/tty_ioctl.4.html | |
/usr/include/sys/termios.h |
This file contains 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
f L;;i0 | |
f;1 i;;;;;L | |
L;;;1 G;;;;;;;;L | |
f;;;;;iG f;;;;;;;;;;C | |
1;;;;;;;;;tCG00GCCCCfi;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ii11tt;;;;;;;;;;;;;G | |
0i;;;;;;;;;;;;;;;;;1CCL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1 | |
t;;;;;;;;;;;;;;;;;;iCCLi;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;f | |
G;;;;;;;;;;;;;;;;;;;iLCCi;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G | |
t;;;;;;;;;;;;;;;;;;;;LCC1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1 | |
G;;;;;;;;;;;;;;;;;;;;;fCCt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;C |
This file contains 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/bash | |
# カレントディレクトリのすべてのファイルのTab文字をスペースに変換するワンライナー | |
find -maxdepth 1 -type f | grep -v "\.bak$" | while read f; do expand -t 4 "$f" > "$f.bak"; mv "$f.bak" "$f"; done |
This file contains 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
/** | |
* @file 選択した英文を日本語に翻訳 | |
* | |
* 注:Shift_JISで保存してください (サクラエディタマクロの制約事項) | |
*/ | |
var text = Editor.GetSelectedString(0) | |
.replace(/\r\n/g, '\n') | |
.replace(/\t/g, '') | |
.replace(/\. /g, '.\n'); |
This file contains 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
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
func main() { | |
fmt.Println("Hello, playground") | |
This file contains 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
package main | |
import ( | |
"fmt" | |
"log" | |
"os/exec" | |
) | |
func main() { | |
out, err := exec.Command("ls", "-l").Output() |
OlderNewer