Skip to content

Instantly share code, notes, and snippets.

View idan's full-sized avatar
💫
Prototypin'

Idan Gazit idan

💫
Prototypin'
View GitHub Profile
@carljm
carljm / install-gems.sh
Created May 18, 2011 19:29
ghetto gem-installer that reads something similar to a pip requirements file
#!/bin/bash
vfile=$1
for line in `cat ${vfile}`; do
gem=${line%%=*}
version=${line##*=}
if gem list | grep ${gem} | grep "(${version})"; then
echo "${gem} (${version}) is already installed"
else
gem install ${gem} -v ${version} --no-rdoc --no-ri
fi
@gasman
gasman / gfm.py
Created March 6, 2011 00:57 — forked from mvasilkov/gfm.py
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0).encode('utf-8')).hexdigest()
extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest
@idan
idan / gist:793789
Created January 24, 2011 19:34
Google Docs Companywide Sharing

Sharing the document with "People at <my domain> can find and view" permission:

  • will make it possible for users to search for the document in Google Docs If the user knows the name or part of the name of the document, he can enter it in the Search field at the top of the Google Docs view and click on 'Search <my domain> Docs', If the user doesn't know the name, he can click on 'Show search options' to find other ways to find the document.
  • will add the document to users' Docs view once opened (under 'All Items' and 'Opened by me')
  • to avoid users' Google Docs view to be overflown by files they do not need, the file created by another user will not appear in the Google Docs view until searched and opened.

If you would like the document to appear in the user's Google Docs view without the user having to search for it first, you will need to share the document with him on an individual basis or with a group he is part of.

A quick way to do so is to add the document to a folder shared with the user. For mo

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@toastdriven
toastdriven / haystack.sh
Created October 9, 2009 05:30
haystack.sh
#!/bin/sh
# First, open up GitX
cd ~/Code/Python/django-haystack; gitx
tmux start-server
tmux new-session -d -s Haystack -n git
tmux new-window -tHaystack:1 -n test
tmux new-window -tHaystack:2 -n solr
tmux new-window -tHaystack:3 -n docs
tmux new-window -tHaystack:4 -n runserver