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
RECLONE=yes |
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
# or | |
grep -e hogehoge -e fugafuga | |
# not | |
grep -v hogehoge | |
# ext | |
grep hoge --include="*.conf" |
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
# combine | |
'foo' + 'bar' # foobar | |
'foo' 'bar' # foobar | |
# split | |
'hello world'.split() # ['hello', 'world'] | |
'|foo|bar|'.split('|') # ['', 'foo', 'bar', ''] | |
'alice, bravo, scot, tiger'.split(',', 2) # ['alice, 'bravo', 'scot, tiger'] | |
# ゼロ埋め |
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
# 単純なループ | |
for i in range(5): | |
print i | |
''' | |
0 | |
1 | |
2 | |
3 | |
4 |
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
class A: | |
def aaa(self): | |
''' instance method''' | |
print 'hello world' | |
@classmethod | |
def bbb(): | |
'''class method''' | |
print 'this is pen' |
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
import httplib | |
def http_req(host, port = 80, method = 'GET', uri = '', headers = {}, body=''): | |
con = httplib.HTTPConnection(host, port) | |
con.request(method, uri, body, headers) | |
resp = con.getresponse() | |
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
import argparse | |
def exist_user(string): | |
exist_users = ['taro','jiro','saburo','ichi','ni','san'] | |
if string not in exist_users: | |
raise argparse.ArgumentTypeError("%s is not exist user"%(string)) | |
return string | |
parser = argparse.ArgumentParser(prog='test command', description='this is description text.') |
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> | |
typedef void (*FUNC)(const char*); | |
void printmsg(const char* msg) { | |
printf("print message is '%s'\n", msg); | |
} | |
int main(int argc, char** argv) { | |
FUNC f = &printmsg; |
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
DESTDIR = bin | |
PROGRAM = $(DESTDIR)/test | |
SRCS = main.cpp sub.cpp | |
OBJS = $(SRCS:.cpp=.o) | |
DEPS = $(SRCS:.cpp=.d) | |
VPATH = src | |
CXXFLAGS = -I include/ |
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
git submodule add git://github.com/submodule/url.git submodule |