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
#include <stdio.h> | |
int main(void) | |
{ | |
int x = 1; | |
int *p = &x; | |
printf("%d\n", x); | |
printf("%p\n", &x); | |
printf("%d\n", *&x); |
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
# directory name | |
ls -laF | ruby -e '$stdin.read.scan(%r![\S]+/!) {|m| puts m}' | |
# or | |
ls -laF | ruby -ne 'puts $_.split("\s")[8]' |
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
ruby -r open-uri -e 'open("http://uni.2ch.net/newsplus/") {|f| puts f.read.scan(/<a.+?>\d+?:\s(.+?)</)}' | nkf -w |
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
ruby -r open-uri -e 'open("http://b.hatena.ne.jp/hotentry") {|f| puts f.read.scan(/entry-link.+?>(.+?)</)}' | sed -e "s/続きを読む//g" |
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
ruby -r open-uri -e 'open("http://www.yahoo.co.jp") {|f| puts f.read.scan(/topics.+?>(.+?)</)}' |
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
ruby -r pp -e 'pp ENV.to_hash' |
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
#coding: utf-8 | |
class M1 | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
env = env + '1' | |
res = @app.call(env) |
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
ruby -ane 'puts $F[0]' hoge.txt > hoge2.txt |
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
find ./ -name 'filename' | |
grep -irs 'query' ./ |
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 | |
class C | |
{ | |
public function foo() { | |
echo "foo"; | |
} | |
} | |
$c = new C(); |