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 | |
# chromium-clean | |
# | |
# Clean chromium profile | |
dir=$(mktemp -d) | |
/usr/bin/chromium --user-data-dir=$dir "$@" | |
rm -rf $dir |
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 sys | |
print('\n'.join(' '.join(col) for col in zip(*reversed([line.split(' ') for line in sys.stdin.read().rstrip().split('\n')])))) |
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
"""Search against AniDB titles dump. | |
""" | |
import argparse | |
import xml.etree.ElementTree as ET | |
import pickle | |
import os | |
import re |
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/python3 | |
""" | |
ytplay | |
====== | |
Play a list of youtube songs from stdin, echoing to stdout. | |
""" |
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
(defun star (input) | |
"Make star." | |
(let* ((l (length input)) | |
(lo (- l 1)) | |
(ll (- (* 2 l) 1)) | |
(star (make-array (list ll ll) :initial-element #\Space))) | |
(dotimes (i l) | |
(let ((a (+ 0 i)) | |
(b (- ll i 1))) | |
(map nil (lambda (x y) (setf (aref star x y) (aref input i))) |
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 python3 | |
(lambda sys:(lambda input:(lambda ilen:(lambda m,olen:(lambda star:(lambda f,g:None)(list(map(lambda i:(lambda b:list(map(lambda x,y: star[x].__setitem__(y,input[i]),[i,b,m,m,i,i,b,b],[m,m,i,b,i,b,i,b])))(olen-i-1),range(ilen))),print("\n".join("".join(char for char in row) for row in star))))([[" " for x in range(olen)] for x in range(olen)]))(ilen-1,2*ilen-1))(len(input)))(sys.argv[1]))(__import__('sys')) |
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
(use-package delight) | |
(add-to-list 'use-package-keywords :delight t) | |
(defun use-package-normalize/:delight (name-symbol keyword args) | |
"Normalize arguments to delight." | |
(cond | |
((and (= (length args) 1) | |
(symbolp (car args))) | |
(list (car args) nil name-symbol)) |
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
class MultiMethod: | |
def __init__(self, func): | |
self.func = func | |
self.methods = {} | |
def __call__(self, *args, **kwargs): | |
return self.methods[self.func(*args, **kwargs)](*args, **kwargs) | |
def method(self, case): |
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
<br /> | |
<h1>Heading one</h1> | |
<h2>Header two</h2> | |
<h3>Header three</h3> | |
<h4>Header four</h4> | |
<h5>Header five</h5> | |
<h6>Header six</h6> | |
<p>This is a copy of one of the sample pages from the <a href="http://www.wordpress.org" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://www.wordpress.org', 'WordPress']);" >WordPress</a> theme development test content. I found it handy to keep a copy of this for building sites that aren’t using WordPress. 99% of the credit goes to them, I’m just hosting it in a handy place in case it’s useful to anyone other than me.</p> | |
<h2>Blockquote Tests</h2> | |
<p>Blockquote:</p> |
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
class SwitchCase: | |
""" | |
Simple implementation of switch-case statements in Pythonic style. | |
>>> switch = SwitchCase() | |
Adding case handlers: | |
>>> @switch.case('foo') |