Skip to content

Instantly share code, notes, and snippets.

@yiboyang
yiboyang / xclip aliases for startup scripts
Last active February 21, 2024 18:21
A few xclip aliases to simplify copying/pasting
# to simplify life, install xclip and append the following lines to your .bashrc
alias "c=xclip" # copy to X clipboard (register *)
alias "cs=xclip -selection clipboard" # copy to system wide clipboard (register +)
alias "v=xclip -o" # output copied content (paste)
alias "vs=xclip -o -selection clipboard" # paste from system wide clipboard (equivalent to `v -selection clipboard`)
# examples:
# copy to X:
# go to the same directory in terminal 2 as in terminal 1
# Terminal 1:
@leblanc-simon
leblanc-simon / get_password_odoo.py
Created June 30, 2015 10:13
Get password from Odoo session
#!/usr/bin/python
import os
from werkzeug.contrib.sessions import FilesystemSessionStore
session_store = FilesystemSessionStore(os.path.expanduser('~/.local/share/Odoo/sessions'))
passwds = []
for sid in session_store.list():
session = session_store.get(sid)
@astrojuanlu
astrojuanlu / fuckda.py
Created June 8, 2014 10:00
Uso de certificados de la FNMT con Python
# coding: utf-8
#
# fuckda.py - Uso de certificados de la FNMT con Python
#
# Autor: Juan Luis Cano Rodríguez <juanlu001@gmail.com>
#
# Instrucciones:
#
# 1. Exportar certificado (CERTIFICADO.p12)
# https://www.sede.fnmt.gob.es/preguntas-frecuentes/exp-imp-y-elim-de-certificados
@ckarmann
ckarmann / .gitconfig
Created November 29, 2013 19:55
git config aliases
alias.unstage=reset HEAD --
alias.last=log -1 HEAD
alias.merge-to=!gitmergeto() { export tmp_branch=`git branch | grep '* ' | tr -d '* '` && git checkout $1 && git merge $tmp_branch && git checkout $tmp_branch; unset tmp_branch; }; gitmergeto
alias.st=status
alias.save=!gitsave() { git checkout -b $1 && git commit -am $1 && git checkout -; }; gitsave
alias.co=checkout
alias.tmpignore=!git update-index --assume-unchanged
alias.tmpunignore=!git update-index --no-assume-unchanged
alias.tmpignored=!git ls-files -v | grep ^[a-z]
alias.mylog=!git log --pretty=format:'%h|%an|%ad|%s' --date=local --since='2 weeks ago' | while IFS='|' read hash author date message; do printf '\e[m%s \e[1;31m%-20s \e[m%s \e[0;32m%s
@iambibhas
iambibhas / scopes.txt
Last active May 5, 2024 06:39
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@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: