Skip to content

Instantly share code, notes, and snippets.

import os
import sys
from math import ceil, floor
from PIL import Image
RATIO = (1/2.35)
SYMBOL_STRING = '&#.:*"..'
EIGHT_COLOR = [(0, 0, 0), # 0
..............................................................................................................................................
..............................................................................................................................................
................................................................................................................******........................
.*****...***"*....**""*....**"*****....****..........*****...*"*"*....*""""................"**""*"*.......""**"*.......**...**""*..******.....
.***"********.....*****..."**"*......................****"***"*"*.....***""..............*"""*..***"*...*"*"*...............****"**"**........
.*****.....*****..*****...*"*"*......***"*"*.........*""**.....**""*..*"*""............**""********""*...*"""*..............*****..*****......
.**************...*****.....***"******"""""*.........""*******"""**...**************..*"*"*........*"***....*"******"**""...*"***.....******..
.......................
......................................................................................................................................................................
......................................................................................................................................................................
......................................................................................................................................................................
.**"****"**""***.....******.......***"****"***""**............""***"**"**"***.....**""**...................*"***""*..........**"*****""***"***...******....**""**.....
.****"*....***"*.....**"*"*....***""*.........................*"""*.....*""**.....*""***.................*"*""**""**.......****"*................**"***.***""*........
.*********"*"***.....**"***..."*"***.......********...........*"*"""*""""""***....***""*...............******...*"""**....*"*"**.................***"********.........
.******......******..*
[[('NAME: elethiomel_entry_fortress_basement',
'MONS: gnoll, jackal, worm'),
('NAME: dpeg_entry_castle', 'MONS: fungus'),
('NAME: elethiomel_entry_diamonds', 'MONS: rat, goblin, bat, kobold'),
('NAME: erik_entry_gehennom', 'MONS: rat, goblin, kobold, ooze'),
('NAME: dpeg_entry_morbid_curiosity', 'MONS: goblin ; stone'),
('NAME: matt_entry_debris', 'MONS: plant'),
('NAME: dpeg_entry_circle_labyrinth_a',
'MONS: plant / bush w:3, fungus col:any, fungus col:yellow, fungus col:red'),
('NAME: minmay_entry_shoal_huts', 'MONS: plant'),
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
import re
import time
comp_re = re.compile(r'^1?$|^(11+?)\1+$')
def regex_prime(args):
primes = [2]
for n in xrange(*args):
if not re.match(comp_re, str(1) * n):
primes.append(n)
#!/usr/bin/env bash
#
# single step iTunes external drive ejection
disk="/dev/disk2"
music_path=/Volumes/media/music
itunes_pid=$(pgrep "^itunes$")
itunes_status=$(lsof -p "$itunes_pid" | grep "$music_path")
#<start test.md>
Inline *markup* **test**.
Paragraph^block and^(multiple super)^test
~~More~~ inline [tests](http://www.example.com)
Inline `fixed width text` and \*escaped format test\*
The following is a block of code:
# Configuration file for ipython.
c = get_config()
#------------------------------------------------------------------------------
# TerminalInteractiveShell configuration
#------------------------------------------------------------------------------
# pager settings
c.TerminalInteractiveShell.pager = 'less'
c.TerminalInteractiveShell.color_info = True
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase