Skip to content

Instantly share code, notes, and snippets.

View tef's full-sized avatar
💭
Please don't try to contact me over GitHub.

tef tef

💭
Please don't try to contact me over GitHub.
View GitHub Profile
1. pandoc -D latex > pandoc.template.jp.tex
2. following instructions from https://groups.google.com/d/msg/pandoc-discuss/R8T4j7SrJXk/EXNLBcm28z0J
go into the .tex file and change the XeTeX part so it reads:
\ifxetex
\usepackage{fontspec,xltxtra,xunicode,xeCJK}
\setCJKmainfont{Kochi Mincho}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
@tef
tef / foo.md
Last active December 22, 2015 16:28
tef-taco
  1. make a bacon sandwich. why not put a bit of soy and cumin in the pan.
  2. use the bacon fat to fry some onions for like 40 minutes
  3. in the meantime, go and chop up some spring onions, cherry tomatoes and leaf salad. put in a bowl with a pinch of fresh coriander and a squirt of lime juice
  4. still in the meantime, go and chop up some garlic (like a bulb), some chilli
  5. take some beef mince, some diced chorizo and whip it up with some paprika, coriander, soy, tamari, gochujang, pepper, cayenne pepper, worchestershire sauce, maybe a hint of chipolte, and a whizz of lime juice. oh and i used ginger
  6. chuck chilli and garlic in the pan after the onions have gotten impatient (around 30-40-50 minutes)
  7. wait a little longer, about 10 minutes, and mash the meat into the pan and fry
  8. make some gnocchi.
  9. now everything smells tasty, and the meat is browned and cooked, chuck in some (whatever) beans from a tin.
  10. take the cooked gnocchi and chop it a little and stick it in the pan too. ooh

I hate markdown

  1. Here is a list. I can do numbered lists.

  2. I can do a list entry followed by two spaces.

    This means this is in the same paragraph

  3. If I want a code block (with syntax highlighting, inside a list, something breaks:

@tef
tef / diff.md
Last active February 14, 2018 05:49
best diff ever
-                 Z    A 
-             Y            B
-         X                    C
-                        
-      W                           D
-                        
-    V                               E
-
-  U                                   F
@tef
tef / ersatz.bibimbap.rst
Last active December 21, 2015 02:19
try not to poison yourself with this weird old tip

ersatz bibimbap

bibimbap as i make it is basically

  • rice
  • sitr fried vegetables
  • some meat in tasty spices
  • gochujang (this is fermented soy bean paste with paprika)
  • a fried egg
from turtle import *
def curve(depth, length, angle):
if depth == 0:
if angle > 0:
pencolor('green')
else:
pencolor('blue')
forward(length)
@tef
tef / python_ruby.py.rb
Last active December 17, 2015 13:29
python/ruby quine. changes comment to indicate what it last ran as.
# Python or Ruby
l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10)),'l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10))','print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q)))'
print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q)))
# coding=utf-8
import sys
normal = u' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~'
wide = u' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!゛#$%&()*+、ー。/:;〈=〉?@[\\]^_‘{|}~'
widemap = dict((ord(n), w) for n,w in zip(normal, wide))
while True:
line = sys.stdin.readline()
if not line:
@tef
tef / flatten.py
Created January 5, 2013 05:53 — forked from anonymous/flatten.py
import collections
import itertools
def flattened(i):
i = iter(i)
while True:
first = i.next()
if isinstance(first, collections.Iterable):
i = itertools.chain(first, i)
else:
def flatten(source):
stack = source[::-1]
while stack:
top = stack.pop()
if hasattr(top, '__iter__'):
stack.extend(reversed(top))
else:
yield top
print list(flatten([1,[2,3,[4,5,[6],7],8,[9,[10,11],[12],[[13]],[[[14,15]]],16]]]))