Skip to content

Instantly share code, notes, and snippets.

@3noch
3noch / keybase+git-crypt.md
Last active February 16, 2020 20:55
How to add a Keybase user to your repo using git-crypt
keybase pgp pull <keybase.io user>
gpg --edit-key <keybase.io user>
  > lsign
  > save
git-crypt add-gpg-user <keybase.io user>
@Jonty
Jonty / .gitconfig
Last active January 11, 2018 11:55
A git alias to rebase all commits added on the current branch
[alias]
rebase-branch = !git rebase -i --autosquash $(git merge-base --fork-point origin/master HEAD)
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active February 25, 2024 13:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

(ns react-cljs.core
(:require React))
(declare render)
(defn handle-change [e]
(render {:text (.. e -target -value)}))
(defn render [{:keys [text]}]
(React/renderComponent
@tgecho
tgecho / readme.txt
Created December 11, 2012 18:13
LiveReload compatibility hack for Webassets
Tested with LiveReload 2.3.18
The only requirement is that the updating requests are sent with ?livereload={etc} in the url.
LiveReload should be configured to NOT compile the assets, as we want webassets to take care of this. We're
just using LR for the notification/loading parts.
@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:

@ibrahima
ibrahima / request_queue.py
Created July 20, 2012 22:21
A silly class that lets you use Grequests in a somewhat similar manner as the ruby gem Typhoeus
import grequests
from collections import deque
class RequestQueue(object):
"""
This is a lame imitation of a Typhoeus Hydra using GRequests.
The main thing this allows is building up a queue of requests and then
executing them, and potentially adding requests to the queue in a callback
so that you can build requests that depend on other requests more naturally.
@trongthanh
trongthanh / gist:2779392
Last active April 17, 2024 12:12
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@alvinl
alvinl / vpn.sh
Created April 21, 2012 20:45
Script to install pptp on Debian 6
#!/bin/bash
apt-get update
apt-get install pptpd -y
echo localip 192.168.240.1 >> /etc/pptpd.conf
echo remoteip 192.168.240.2-9 >> /etc/pptpd.conf
echo ms-dns 8.8.8.8 >> /etc/ppp/pptpd-options
echo ms-dns 8.8.4.4 >> /etc/ppp/pptpd-options
echo "vpn pptpd pass123 *" | tee -a /etc/ppp/chap-secrets
/etc/init.d/pptpd restart
@jolby
jolby / core.cljs
Created August 2, 2011 00:12
Clojurescript on Appcelerator Titanium
(ns tiexample.core)
(defn ^{:export dbg} dbg [s]
(js* "Titanium.API.debug(~{s})"))
;;stolen from another gist I saw
(defn make-js-map
"makes a javascript map from a clojure one"
[cljmap]
(let [out (js-obj)]