Skip to content

Instantly share code, notes, and snippets.

View puhitaku's full-sized avatar
:octocat:
= 🐙 + 🐱

Takumi Sueda puhitaku

:octocat:
= 🐙 + 🐱
View GitHub Profile
@puhitaku
puhitaku / git
Created May 7, 2014 08:00 — forked from poutyface/git
githubへ登録
===========
git remote add origin git@github.com:<username>/<application_name>.git
git push origin master
初期設定
=======
git config --global user.name "Foo Bar"
git config --global user.email "foo@bar.com"
@puhitaku
puhitaku / prime.py
Created November 24, 2014 13:27
Infinite prime number list
class Prime:
def __init__(self):
self.found = []
self.i = 2
self.idx = -1 #Iterator用
def __getitem__(self, n): #n番目の素数が見つかるまでwhileを回す
while len(self.found) < n+1: #すでに見つかっていれば定数時間ですむ
if not any(self.i % x == 0 for x in self.found):
self.found.append(self.i)
@puhitaku
puhitaku / patorjk.css
Created March 3, 2015 08:27
Patorjk.com AA Generator - Stylish CSS
/*Overrides font-family value for backslashes.*/
.fig {
font-family: Consolas, monospace !important;
}
@puhitaku
puhitaku / sharelatex.css
Last active August 29, 2015 14:16
ShareLaTeX.com - Stylish CSS
/*Fonts, Colors*/
.ace_content{
font-family: "Consolas", "MeiryoKe_Console";
/* --- Alternative fonts ---
font-family: "Ubuntu Mono", "Migu 1m";
font-family: monospace;
*/
}
@puhitaku
puhitaku / wikipedia.css
Last active August 29, 2015 14:16
Wikipedia.org - Stylish CSS
body{
font-family:'Arial', 'ヒラギノ角ゴ3', 'Meiryo' !important;
background:#fff !important;
font-size:17px !important;
}
h1{
border:0px !important;
font-family:'Arial', 'ヒラギノ角ゴ3', 'Meiryo' !important;
font-weight:700 !important;
font-size:36px !important;
@puhitaku
puhitaku / .tmux.conf
Last active November 12, 2018 16:42
My .tmux.conf
unbind C-b
set -g prefix C-a
# If the escape delay persists, try setting `set keyseq-timeout 1` in .inputrc .
set -g escape-time 0
# Split
bind | split-window -h
bind - split-window -v
@puhitaku
puhitaku / keep.css
Created April 8, 2015 07:10
keep.google.com - Stylish CSS
.IZ65Hb-YPqjbf.CmABtb-YPqjbf {
font-family: Meiryo;
}
.IZ65Hb-YPqjbf {
font-family: Roboto Condensed, Meiryo;
}
@puhitaku
puhitaku / brooks.py
Created April 14, 2015 09:24
BROOKS Coffee price parser
import re #regex
import requests as req
from bs4 import BeautifulSoup as bs
def get_text(url):
src = req.get(url)
return src.text.encode(src.encoding)
def get_price(product_url):
soup = bs( get_text(product_url) )
@puhitaku
puhitaku / oneliners.py
Last active August 29, 2015 14:20
One-liners in Python
#文字数を各文字ごとに数えてタプルのリストで返す
#Count characters and return the result with list of tuples.
#e.x. c('bbaaac') = [('a', 3), ('b', 2), ('c', 1)]
count = lambda s: [(c,s.lower().count(c)) for c in sorted(set(s.lower()))]
#6ケタのHEXを3つのDECのリストにして返す
#Convert 6 digits HEX in 3 decimals and return tuple.
#e.x. d('0099CC') = [0, 153, 204]
hexcol = lambda h: [int(h[i:i+2],16) for i in range(0, len(h), 2)]
@puhitaku
puhitaku / datajoy.css
Last active August 29, 2015 14:24
getdatajoy.com
/*Fonts, Colors*/
.ace_content{
font-family: "Consolas", "Source Han Code JP Medium";
}
.jupyter-output{
background-color: #272822 !important;
}