Skip to content

Instantly share code, notes, and snippets.

@draftcode
draftcode / gist:1357281
Created November 11, 2011 05:35
構文解析 Howto

構文解析 Howto

Author: draftcode
Date: 2011-11-11T13:18:07+09:00
ID:289a0136-0c1c-11e1-a06b-040ccee352e6

こうぶん、かいせきー

@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)
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}