start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from flask import Flask | |
from flaskext.sqlalchemy import SQLAlchemy | |
from werkzeug.security import generate_password_hash | |
from werkzeug.security import check_password_hash | |
from sqlalchemy.orm.exc import NoResultFound | |
app = Flask(__name__) |
"use strict"; | |
// Uses jQuery and Q. | |
var API_KEY = "whatever"; | |
function getFlickrResponseAsync(method, responseProperty, params) { | |
var deferred = Q.defer(); | |
$.ajax("http://www.flickr.com/services/rest/", { |
# Always ignore one run | |
x = 0 | |
@elapsed for i in 1:100_000_000 | |
x += 1 | |
end # => 3.330939854 | |
# Second time is more accurate |
macro := { | |
rule infix { $obj $([ $key ] ...) | $rval:expr } => { | |
$obj = mori.assoc_in($obj, [$key (,) ...].reverse(), $rval) | |
} | |
} | |
macro hash_map { | |
rule {{ $($key : $value) (,) ... }} => { | |
mori.hash_map($($key, $value) (,) ...) | |
} |
Find it here: https://github.com/bitemyapp/learnhaskell
mem_size = 64 | |
mem_prot = 0x40 # PAGE_EXECUTE_READWRITE | |
mem_type = 0x00001000 # MEM_COMMIT | |
ex_mem = ccall(:VirtualAlloc, | |
Ptr{Uint8}, | |
(Ptr{Void}, Csize_t, Uint64, Uint64), | |
C_NULL, mem_size, mem_type, mem_prot) # call VirtualAlloc and get executable page | |
exec_arr = pointer_to_array(ex_mem, (32,2)); # consider as an array so we can write to it |
(flycheck-define-checker julia-lint | |
"A Julia syntax checker using Lint.jl." | |
:command ("julia" "-e" | |
"using Lint; lintfile(ARGS[1])" source-inplace) | |
:error-patterns | |
((info line-start | |
(zero-or-more blank) | |
(file-name) " " | |
(one-or-more (not digit)) | |
line " INFO" (one-or-more blank) (message) line-end) |
location ~ ^/(wp-admin|wp-login\.php|priv\.dog|companies\/sidekick) { | |
deny all; | |
break; | |
} | |
# file extensions that should never be served, this prevents | |
# potential malicious downloads in case someone manages to manipulate | |
# a Rails URL or write a file that can be served | |
# (~* matches case-insensitive) | |
location ~* \.(?:git|svn|DS_Store|asp|aspx|cgi|pt|pl|idx|php|exe|scpt|AppleScript|dll|dmg|pif|msi|application|msp|com|scr|hta|cpl|gadget|msc|jar|bat|vb|vbs|vbe|ws|wsh|inf|lnk|reg|scf|wsc|wsh|ps1|ps1xml|ps2|ps2xml|psc1|psc2|msh|msh1|msh2|mshxml|msh1xml|msh2xml)$ { | |
deny all; |
#!/bin/sh | |
KERNEL="/path/to/vmlinuz64" | |
INITRD="/path/to/initrd.img" | |
#CMDLINE="earlyprintk=serial console=ttyS0 acpi=off" | |
CMDLINE="loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10:LABEL=boot2docker-data base" | |
MEM="-m 1G" | |
#SMP="-c 2" | |
NET="-s 2:0,virtio-net,en0" |