Skip to content

Instantly share code, notes, and snippets.

defmodule ElxWebserver do
use Foo
use Foo.Bar
def indentation_screwed()
end
Facter.add("is_vagrant") do
setcode do
vagrant = false
if File.exist? "/home/vagrant"
vagrant = true
end
vagrant
end
end
node 'render.local' {
require core
include pdftoolbox
include tet
include nginx
include uwsgi
include sensu
}
#!/usr/bin/env python
from flask import Flask, make_response, request
from sqlalchemy import create_engine
app = Flask(__name__)
engine = create_engine('postgresql://eventcaptureuser:postgres@localhost/event',
pool_size=100, max_overflow=0)
@app.route("/capture", methods=['POST'])
def capture():
defmodule Banana do
def banana do
receive do
:banana -> :io.format "I fucking love bananas."
_ -> :io.format "Nada"
after
1000 -> IO.puts "Nope"
end
end
end
defmodule Banana do
def banana do
receive do
:banana -> :io.format "I fucking love bananas."
_ -> :io.format "Nada"
after
1000 -> IO.puts "Nope"
end
end
# Add this alias either by command line:
$ git config --global alias.lm 'log --pretty=format:\'%Cred%h%Creset %C(bold blue)<%an>%Creset -%C(yellow)%d%Creset %C(bold cyan)%s %Cgreen(%cr)%n%Creset%n - %b%n\' --abbrev-commit --date=relative --merges'
# or add this to the [alias] section of ~/.gitconfig
# lm = log --pretty=format:'%Cred%h%Creset %C(bold blue)<%an>%Creset -%C(yellow)%d%Creset %C(bold cyan)%s %Cgreen(%cr)%n%Creset%n - %b%n' --abbrev-commit --date=relative --merges
# Then execute the command, optionally (but I can't imagine why you'd use it without them) adding a range of commits:
$ git lm 1.7..HEAD
#!/bin/bash
# You can run this to make fetch automatically prune any time you pull or
# fetch.
#
# git config remote.origin.prune true
git fetch --prune
# Abort early if there are local changes
git checkout master || exit
;; With numeric ARG, display the tool bar if and only if ARG is
;; positive. Tool bar has icons document (read file), folder (read
;; directory), X (discard buffer), disk (save), disk+pen (save-as),
;; back arrow (undo), scissors (cut), etc.
(tool-bar-mode 0)
;; Get rid of the annoying splash and startup screens
(setq HOME (expand-file-name "~/"))
(setq PATH (getenv "PATH"))
(setenv "PATH" (concat PATH ":/opt/vagrant/bin:" (concat HOME "bin")))
function brazzers (x, y) {
var dfd;
dfd = new $.Deferred;
if (x < y) {
dfd.reject("Fail");
} else if (y < x) {
dfd.reject("Fail");
} else {
dfd.resolve(x + y);