Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
cat .gitignore | egrep -v "^#|^$" | while read line; do
if [ -n "$line" ]; then
OLD_IFS=$IFS; IFS=""
for ignored_file in $( git ls-files "$line" ); do
git rm --cached "$ignored_file"
done
IFS=$OLD_IFS
fi
@karmi
karmi / .gitignore
Created November 27, 2010 16:26
`tail -f` in Node.js and WebSockets
.DS_Store
*.log
tmp/
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@judy-zz
judy-zz / variables.css.less
Created June 18, 2012 03:45
Solarized colors for Twitter Bootstrap
@black: #002b36;
@grayDarker: #586e75;
@grayDark: #657b83;
@gray: #839496;
@grayLight: #93a1a1;
@grayLighter: #eee8d5;
@white: #fdf6e3;
@blue: #2aa198;
@blueDark: #268bd2;
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 24, 2024 15:28
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@wofeiwo
wofeiwo / flup_fcgi_client.py
Created September 14, 2012 06:33
Python FCGI Client
#!/usr/bin/env python
# pylint: disable=W0622
# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
# Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@beniwohli
beniwohli / views.py
Created October 4, 2012 13:10
extension of django.views.generic.ListView for sorted lists
# -*- coding: utf-8 -*-
from django.views.generic import ListView
class SortableListView(ListView):
allowed_sort_fields = ()
sort_default = None
sort_key = 'sort'
sort_field_splitter = '-'
sort_ascending_postfix = 'up'
sort_descending_postfix = 'down'
@atdt
atdt / huggle3.rb
Created December 10, 2013 17:18
Huggle formula for Homebrew
require 'formula'
class Huggle3 < Formula
homepage 'https://en.wikipedia.org/wiki/Wikipedia:Huggle'
head 'https://github.com/huggle/huggle3-qt-lx.git'
sha1 '15072960560b963ab317b2088ff8951f8c5287ae'
depends_on 'qt'
def install
@clarkdave
clarkdave / logstash-sentry.rb
Last active May 15, 2023 11:34
(Logstash) Sentry output plugin
# The MIT License (MIT)
# Copyright (c) 2014 Dave Clark
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: