Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
DJANGO_VERSION=1.4
VENV="django$DJANGO_VERSION"
# create virtualenv: "django<version>" e.g. django1.4
mkdir lib
cd lib
virtualenv --system-site-packages $VENV
cd $VENV
@WaYdotNET
WaYdotNET / Vagrantfile
Last active August 29, 2015 14:08 — forked from gasman/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Base box to build off, and download URL for when it doesn't exist on the user's system already
config.vm.box = "wagtail-base-v0.1"
config.vm.box_url = "http://downloads.torchbox.com/wagtail-base-v0.1.box"
# You can also build from a vanilla precise32 box, although it'll take longer
// jQuery.naturalWidth / jQuery.naturalHeight plugin for (already-loaded) images
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy!
(function($) {
function img(url) {
var i = new Image;
i.src = url;
return i;
}
@WaYdotNET
WaYdotNET / index.md
Created February 28, 2013 22:42 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
# it is forked from https://github.com/xijo/reverse-markdown/blob/master/reverse_markdown.rb
require 'rexml/document'
require 'benchmark'
include REXML
include Benchmark
class ReverseMarkdown
# set basic variables:
# - @li_counter: numbering list item (li) tags in an ordered list (ol)
@WaYdotNET
WaYdotNET / gist:1944182
Created February 29, 2012 20:33 — forked from wisq/gist:1507733
Why I love zsh (and hate being forced to use bash)

Why I love zsh (and hate being forced to use bash)

  • Smarter completion:
  • cd tab completion -- directories only
  • bash can do this, but needs the bash-completion package, usually comes separately
  • zsh always comes with completions, why doesn't bash?
  • Filename correction during completion
  • if dir1/x exists and dir2 exists, then "dir/x<TAB>" completes to dir1/x
  • if name1 is a file and name2 is a directory with files in it, "name/<TAB>" completes to "name2/"
;; init.el
;; Vincent Foley - [email protected]
(require 'cl)
(defmacro when-package-installed (package-name &rest body)
`(if (package-installed-p ,package-name)
(progn ,@body)
(warn "package %s is not installed" ,package-name)))