This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = 'http://files.vagrantup.com/precise64.box' | |
config.vm.provision "shell", path: "provision.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. cp -r old_repo new_repo | |
2. cd new_repo | |
3. For all branches you want to preserve, ensure you have local tracking branches setup: 'git checkout branch1' | |
4. git filter-branch --subdirectory-filter directory/to/split master branch1 ... (for preserving master and branch1) | |
5. Unless there are any tags you want to preserve, just remove all tags: | |
6. git tag -l | xargs git tag -d | |
7. git remote rm origin | |
8. git remote add origin git@new.remote.git | |
9. git gc | |
10. git config --add remote.origin.push '+refs/heads/*:refs/heads/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Acquire::http::Proxy \"http://rpiapt:3142\";" > /etc/apt/apt.conf.d/01proxy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ Desktop brew install -v dvdauthor | |
==> Downloading http://downloads.sourceforge.net/project/dvdauthor/dvdauthor/0.7.1/dvdauthor-0.7.1.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/dvdauthor-0.7.1.tar.gz | |
/usr/bin/tar xf /Library/Caches/Homebrew/dvdauthor-0.7.1.tar.gz | |
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/dvdauthor/0.7.1 --mandir=/usr/local/Cellar/dvdauthor/0.7.1/share/man | |
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/dvdauthor/0.7.1 --mandir=/usr/local/Cellar/dvdauthor/0.7.1/share/man | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes | |
checking for a thread-safe mkdir -p... autotools/install-sh -c -d | |
checking for gawk... no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for placing sudoers.d files with syntax-checking | |
if [ -z "$1" ]; then | |
# Making a temporary file to contain the sudoers-changes to be pre-checked | |
TMP=$(mktemp) | |
cat > $TMP <<EOF | |
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports | |
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart | |
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s,z,Z,L,X=" ","%s",zip,len,xrange;print"\n".join(x.rstrip()for x in(lambda y:y[0](y,5,1))([lambda y,n,w:[s*w for _ in X(1,w)]+["__"*w]if n==0 else[z*3%(s*(L(t)//2),t,s*(L(t)//2))for t in y[0](y,n-1,w)]+[z*2%m for m in Z(y[1](y,n-1,w),y[2](y,n-1,w))],lambda y,n,w:[(s*i)+"/"+(s*j)for(i,j)in Z(X(w-1,-1,-1),X(w,w*2))]if n==0 else[z*3%(s*(L(t)//2),t,s*(L(t)//2))for t in y[2](y,n-1,w)]+[z*2%m for m in Z(y[0](y,n-1,w),y[1](y,n-1,w))],lambda y,n,w:[(s*i)+"\\"+(s*j)for(j,i)in Z(X(w-1,-1,-1),X(w,w*2))]if n==0 else[z*3%(" "*(L(t)//2),t," "*(L(t)//2)) for t in y[1](y,n-1,w)]+ [z*2%m for m in Z(y[2](y,n-1,w),y[0](y,n-1,w))]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ brew install glib | |
==> Installing glib dependency: gettext | |
==> Downloading http://ftpmirror.gnu.org/gettext/gettext-0.18.1.1.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/gettext-0.18.1.1.tar.gz | |
==> Downloading patches | |
######################################################################## 100.0% | |
######################################################################## 100.0% | |
==> Patching | |
patching file gettext-tools/configure | |
patching file gettext-tools/Makefile.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var seconds = 60 | |
locache.set("key", { | |
'user': 1, | |
'books': ['a', 'b', 'c'] | |
}, seconds) | |
locache.get("key") | |
// {'user': 1, 'books': ['a', 'b', 'c']} | |
// Note the object is returned, not a string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.utils.functional import curry | |
def contribute_to_model(contrib, destination): | |
""" | |
Update ``contrib`` model based on ``destination``. | |
Every new field will be created. Existing fields will have some properties | |
updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT_DIR="$(dirname "${BASH_SOURCE:-$0}" )"; | |
ABSOLUTE_DIR=`$SHELL -c "cd \"$PROJECT_DIR\" && pwd"`; | |
PROJECT_NAME="$( basename $ABSOLUTE_DIR)"; | |
if [[ -n $PROJECT_NAME && $VIRTUAL_ENV != *"$PROJECT_NAME" ]]; | |
then workon $PROJECT_NAME; | |
fi; | |
unset PROJECT_DIR; | |
unset ABSOLUTE_DIR; |