Skip to content

Instantly share code, notes, and snippets.

@puckbag
puckbag / sync-down.sh
Created August 1, 2012 21:11
Drupal Sync Down (From Production to Development)
#!/bin/sh
SSH=user@host
DATABASE=xxxxxx
USERNAME=xxxxxx
PASSWORD=xxxxxx
WEBROOT=/var/www/html/
LOCAL_DATABASE=xxxxxx
@puckbag
puckbag / gist:3359908
Created August 15, 2012 12:55
Firebug Lite Bookmarklet
(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
@puckbag
puckbag / Preferences.sublime-settings.json
Created March 21, 2013 16:09
Sublime Text User Settings
{
"bold_folder_labels": true,
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", ".sass-cache"],
"font_size": 12,
"open_files_in_new_window": false,
"preview_on_click": false,
"rulers": [80],
"tab_size": 4,
"translate_tabs_to_spaces": true
}
@puckbag
puckbag / .colors.bash
Last active December 15, 2015 09:38
Prompt colors for Bash.
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt#List_of_colors_for_prompt_and_Bash
# Reset
COLOR_OFF='\[\e[0m\]' # Text Reset
# Regular Colors
COLOR_BLACK='\[\e[0;30m\]' # Black
COLOR_RED='\[\e[0;31m\]' # Red
COLOR_GREEN='\[\e[0;32m\]' # Green
COLOR_YELLOW='\[\e[0;33m\]' # Yellow
@puckbag
puckbag / sync-downstream.sh
Last active December 19, 2015 12:59
A shell script to automate syncing a website downstream during development, including a database and media directory. Supports (MySQL,MsSQL) --> (MySQL,SQLite). Requires wget and sequel. Assumes broco environment.
#!/bin/bash
doc_root=
ftp_domain=
ftp_host=
ftp_user=
ftp_pass=
db_remote_type=tinytds
db_remote_data=
db_remote_host=
@puckbag
puckbag / prompt.css
Created March 3, 2014 05:50
prompt.html
/*
hex:00 / rgb:0
hex:55 / rgb:85
hex:BB / rgb:187
hex:FF / rgb:255
*/
.normal-black {
color: black; }
.normal-red {
#!/bin/bash
# example usage:
# $ sync-branch origin/production production
# issues:
# * what if files have been modified? handle pull failure.
# http://stackoverflow.com/a/12791408/1596013
# http://stackoverflow.com/a/12142066/1596013
This file has been truncated, but you can view the full file.
;;; Provided courtesy of http://browscap.org/
;;; Created on Thursday, March 27, 2014 at 12:25 PM EDT
;;; Keep up with the latest goings-on with the project:
;;; Follow us on Twitter <https://twitter.com/browscap>, or...
;;; Like us on Facebook <https://facebook.com/browscap>, or...
;;; Collaborate on GitHub <https://github.com/browscap>, or...
;;; Discuss on Google Groups <https://groups.google.com/forum/#!forum/browscap>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap Version
@puckbag
puckbag / gist:2acc0f2002b6bd96abce
Last active August 29, 2015 14:04
How while and for loops function the same
// demonstrate how to construct the same loop with while and with for.
// a limited loop in while format
var limit = 10;
var i = 1;
while (i<=limit) {
console.log(i);
i = i + 1;
}
@puckbag
puckbag / transfer-db.sh
Last active August 29, 2015 14:04
Transfer AMPPS db to MAMP
#!/bin/bash
# http://dev.mysql.com/doc/refman/5.5/en/copying-databases.html
PWD=`pwd`
# http://stackoverflow.com/a/3572105
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}