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 string | |
def caesar(plaintext, shift): | |
alphabet_lower = string.ascii_lowercase | |
alphabet_upper = string.ascii_uppercase | |
alphabet = alphabet_lower + alphabet_upper | |
shifted_alphabet = alphabet_lower[shift:] + alphabet_lower[:shift] + alphabet_upper[shift:] + alphabet_upper[:shift] | |
table = str.maketrans(alphabet, shifted_alphabet) | |
return plaintext.translate(table) |
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
description "BitTorrent Sync" | |
author "Yawara ISHIDA" | |
start on filesystem or runlevel [2345] | |
stop on shutdown | |
script | |
CONFIG="/etc/btsync/btsync.conf" | |
BTSYNC="/usr/lib/btsync-core/btsync" | |
exec su ywr -c "$BTSYNC --nodaemon --config $CONFIG" |
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
> cat /etc/issue | |
Debian GNU/Linux 7 \n \l | |
> uname -a | |
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.73-2+deb7u2 x86_64 GNU/Linux |
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
In [1]: %load_ext autoreload | |
In [2]: %autoreload 2 | |
In [3]: from foo import some_function | |
In [4]: some_function() | |
Out[4]: 42 | |
In [5]: # foo.pyを開いてsome_functionが43を返すように変更すると |
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
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
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
require 'formula' | |
class GraphTool < Formula | |
homepage 'http://graph-tool.skewed.de/' | |
url 'http://downloads.skewed.de/graph-tool/graph-tool-2.2.31.tar.bz2' | |
sha1 '5e0b1c215ecd76191a82c745df0fac17e33bfb09' | |
head 'https://github.com/count0/graph-tool.git' | |
depends_on 'pkg-config' => :build | |
depends_on 'boost' => 'c++11' |
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
<!DOCTYPE html> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<html> | |
<body> | |
#!/bin/bash | |
echo "Hello, world" | |
touch "~/Desktop/$(date)" | |
</body> | |
</html> |
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
#include <stdio.h> | |
int main(void) | |
{ | |
FILE* fp_out = freopen("/dev/null", "w", stdout); | |
FILE* fp_err = freopen("/dev/null", "w", stderr); | |
printf("Hello, world!\n"); | |
fclose(fp_out); | |
fclose(fp_err); | |
return 0; |
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
#!/usr/bin/env python | |
import itertools | |
import requests | |
from requests.auth import HTTPBasicAuth | |
az = [chr(i) for i in range(ord('a'), ord('z')+1)] | |
AZ = [chr(i) for i in range(ord('Z'), ord('Z')+1)] | |
nums = [str(i) for i in range(10)] |
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 | |
echo $(curl http://www.cman.jp/network/support/go_access.cgi 2>/dev/null | grep '\([0-9]\{1,3\}\.\)\{3\}' | gsed -e 's/.*[^0-9]\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{3\}\).*/\1/' | head -n 1) |
NewerOlder