Skip to content

Instantly share code, notes, and snippets.

@terrafied
terrafied / rmb.sh
Created January 15, 2012 21:22
Remove merged branches from a git repo
#!/bin/bash
# From: http://snippets.freerobby.com/post/491644841/remove-merged-branches-in-git
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]; then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo "Fetching merged branches..."
git remote prune origin
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
@LeaVerou
LeaVerou / dabblet.css
Created April 22, 2012 09:19 — forked from kizu/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@twolfson
twolfson / LICENSE.txt
Created May 12, 2012 19:16 — forked from 140bytes/LICENSE.txt
Atomic event emitter for solving your race conditions
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tmcw
tmcw / foursquare_archive.py
Created August 14, 2012 15:19
Simple Foursquare Checkins Archive of one User
import requests, os, glob, json, sys, webbrowser
you = 'self'
data = 'checkins'
try: os.mkdir(data)
except Exception: pass
cid = 'YOUR_CLIENT_ID'
@twolfson
twolfson / index.md
Last active February 9, 2017 09:03
Good ideas that I will never get around to

npm link for Windows

  • grunt task that watches over node_modules directory in a repo and copies the directory on change
    • Could be also be done with nodemon or something else

SkyDB

CSS as a queue

@twolfson
twolfson / grunt.js
Last active January 5, 2016 21:07
Download and unzip Twitter Bootstrap in one fell swoop with grunt
module.exports = function (grunt) {
// Initial configuration
grunt.initConfig({
// Download external resources
curl: {
// Twitter Bootstrap
bootstrap: {
src: 'http://twitter.github.com/bootstrap/assets/bootstrap.zip',
dest: 'tmp/bootstrap.zip'
}
@twolfson
twolfson / README.md
Last active January 22, 2024 07:33
How Python modules are resolved

Python modules have 2 syntaxes for importing.

import x
from x import y

import x

Absolute imports are used for importing top-level modules and only top level modules. These are ones that are globally installed, either inside of Python core or via a package manager (e.g. pip).

@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@twolfson
twolfson / README.md
Last active May 18, 2016 18:07
WYSIWYG editor evaluation

I forgot to save which WYSIWYG editor I was using earlier. As a result, we have to review them all over again =(

Needs:

  • Allow following link inline
  • Prefer to avoid separation of editing from output

Libraries: