Skip to content

Instantly share code, notes, and snippets.

View xwmx's full-sized avatar

William Melody xwmx

View GitHub Profile
@xwmx
xwmx / .bashrc
Created July 31, 2011 16:33
utc_timestamp
alias utc_timestamp='date -u "+%Y%m%d%H%M%S"'
@xwmx
xwmx / kindlestrip.py
Created August 18, 2011 19:36
kindlestrip.py: for removing unnecessary portions of .mobi/.prc kindle files created with kindlegen
#!/usr/bin/python
#
# This is a python script. You need a Python interpreter to run it.
# For example, ActiveState Python, which exists for windows.
#
# This script strips the penultimate record from a Mobipocket file.
# This is useful because the current KindleGen add a compressed copy
# of the source files used in this record, making the ebook produced
# about twice as big as it needs to be.
#
@xwmx
xwmx / Japanese style
Last active October 1, 2015 13:08 — forked from endolith/Has weird right-to-left characters.txt
Unicode smileys emoticons
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@xwmx
xwmx / gist:2951957
Created June 19, 2012 02:21
git aliases
#==========================================================================
# Git aliases
#==========================================================================
alias g='git'
alias gb='git branch'
alias gba='git branch -a'
alias gstat='git status'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gd='git diff | mate'
@xwmx
xwmx / satipatthana-sutta.markdown
Created November 25, 2012 21:16
Satipatthana Sutta

Majjhima Nikaya 10

Satipatthana Sutta (MN 10)

The Four Paths to Mindfulness

Intermediate Mindfulness Training

Based upon Translations from the Pali by

Oniguruma Regular Expressions Version 5.9.1 2007/09/05
syntax: ONIG_SYNTAX_RUBY (default)
1. Syntax elements
\ escape (enable or disable meta character meaning)
| alternation
(...) group
@xwmx
xwmx / _gravatar.html.haml
Last active December 14, 2015 04:29
simple gravatar from email
%a{:href => user_path(@user)}
= image_tag(@user.gravatar_url({:size => 250,
:default => default_gravatar,
:width => "200px",
:height => "200px"}))

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

; The Lisp defined in McCarthy's 1960 paper, translated into CL.
; Assumes only quote, atom, eq, cons, car, cdr, cond.
; Bug reports to [email protected].
(defun null. (x)
(eq x '()))
(defun and. (x y)
(cond (x (cond (y 't) ('t '())))
('t '())))
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#