Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
@mythmon
mythmon / blocks.md
Last active December 16, 2015 22:29
So I have this idea. I want to make a programming language. I have some goals. Lets see how this works out.

Blocks

Blocks are kind of like functions. The store a sequence of expressions to be evaluated later. They are a value, so like any value they need to be bound to a name to be stored.

let first = {
    print 'Hello, world!'

}

> units
Currency exchange rates from 2012-10-24
2570 units, 85 prefixes, 66 nonlinear units
You have: (1*2*3*4*5*6*7*8*9*10) seconds
You want: days
* 42
/ 0.023809524
URxvt.background: black
URxvt.foreground: grey
URxvt.scrollBar: false
URxvt.cursorBlink: true
URxvt.imLocale: en_US.utf8
URxvt.termName: screen-256color-bce
URxvt.fading: 10
URxvt.saveLines: 40960
URxvt.visualBall: true
function uploadImage {
curl -s -F "image=@$1" -F "key=SOME_IMGUR_KEY_THING" http://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*"
}
scrot -s "/tmp/shot.png"
if [ $? -eq 0 ]; then
uploadImage "/tmp/shot.png" | xclip
rm "/tmp/shot.png"
notify-send "Uploaded screenshot to imgur. URL is on the clipboard."
else
class Document(ModelBase):
links_to_this = models.ManyToManyField('self', related_name='this_links_to',
symmetrical=False, through='DocumentLink')
class DocumentLink(ModelBase):
linked_from = models.ForeignKey(Document, related_name='documentlink_from_set')
linked_to = models.ForeignKey(Document, related_name='documentlink_to_set')
type = models.CharField(max_length=16)
icon_size 16
background "#101010"
geometry 6x1+1504+0
max_geometry 6x1
icon_gravity NE
dockapp_mode simple
window_type dock
kludges force_icons_size
autoload promptinit
promptinit
setopt prompt_subst
autoload -Uz vcs_info
if vcs_info 2> /dev/null; then
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git*:*' get-revision true
zstyle ':vcs_info:git*:*' check-for-changes true
@mythmon
mythmon / gist:5315333
Last active December 15, 2015 19:59
CrimsonTwins file lay out.
What I have:
.
├── static/
│ └── stuff
├── README.md
├── chat.js
├── clients.js
├── config.js
├── config.json-dist
@mythmon
mythmon / git-url
Last active December 15, 2015 03:59 — forked from rlr/git-url
I don't use a mac, and I don't have ack, and I didn't like some other things. I made it better.
#!/bin/sh
# Usage: `git url` or `git url <commitish>`
#
# * copies the commit's github url to your clipboard
# * prints out the log message
# * opens the bugzilla page if it found a bug number
#
# Assumes that the canonical remote is named upstream.
# Works on Linux
#!/bin/bash
function remote_by_name() {
name=$1
remote_line=$(git remote -v | grep push | grep $name)
if [[ -z $remote_line ]]; then
echo "Error: remote '$name' not found."
exit 1