Skip to content

Instantly share code, notes, and snippets.

View pauricthelodger's full-sized avatar

Padraic Harley pauricthelodger

View GitHub Profile
@jacobvosmaer
jacobvosmaer / gist:3187346
Created July 27, 2012 10:35
Open all files with git merge conflicts in Vim

Open all files with git merge conflicts in MacVim

git diff --name-only | uniq | xargs mvim

When git encounters a merge conflict, e.g. during a rebase, it drops you back into the shell with a dirty working directory. I like this one-liner for opening all files with a merge conflict in MacVim.

Once you're in Vim, you can then switch between the files with :n and :prev, or another favourite: :w | n (save current file and open the next command line-supplied file).

UPDATE: see below for a version that works with real terminal commands.

@niwinz
niwinz / output.txt
Created April 20, 2012 19:04
Mini SSH library for python3 based on subprocess
[niwi@vaio.niwi.be][~]% python3 subprocess_ssh.py
(0, b'Linux vaio.niwi.be 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 09:48:37 CEST 2012 x86_64 Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz GenuineIntel GNU/Linux')
(0, b'processor\t: 0\nvendor_id\t: GenuineIntel\ncpu family\t: 6\nmodel\t\t: 23\nmodel name\t: Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz\nstepping\t: 10\nmicrocode\t: 0xa07\ncpu MHz\t\t: 2193.716\ncache size\t: 2048 KB\nphysical id\t: 0\nsiblings\t: 2\ncore id\t\t: 0\ncpu cores\t: 2\napicid\t\t: 0\ninitial apicid\t: 0\nfpu\t\t: yes\nfpu_exception\t: yes\ncpuid level\t: 13\nwp\t\t: yes\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts\nbogomips\t: 4389.24\nclflush size\t: 64\ncache_alignment\t: 64\naddress sizes\t: 36 bits physical, 48 bits virtual\npower management:\n
@comp615
comp615 / leaflet_numbered_markers.css
Created April 2, 2012 23:51
Numbered Markers in Leaflet (JS Mapping)
.leaflet-div-icon {
background: transparent;
border: none;
}
.leaflet-marker-icon .number{
position: relative;
top: -37px;
font-size: 12px;
width: 25px;
@dstufft
dstufft / fabfile.py
Created March 10, 2011 02:01
A fabfile for deploying a Django app with VirtualEnvWrapper, PIP and Supervisor
# Run this like fab -R www deploy
from fabric.api import *
REPO_URL = 'git@github.com:username/repo.git'
PROJECT_DIR = '$HOME/projects/projectname'
PROJECT_NAME = 'projectname'
SERVER_NAME = 'projectname.servername' # I use gunicorn, so i have projectname.gunicorn
env.roledefs['www'] = ['www1.example.com']
@fohlin
fohlin / forms.py
Created January 8, 2011 18:50
A version of Django's UserCreationForm that uses email instead of username, with some nifty features. (Maybe not super robust yet, in terms of concurrency...)
import re
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class UniqueUserEmailField(forms.EmailField):
"""
An EmailField which only is valid if no User has that email.
"""
def validate(self, value):