Skip to content

Instantly share code, notes, and snippets.

View gist:1cfc302fd227f34e977c8f9666b724e3
#!/bin/bash
mkdir -p $HOME/bin
cat > $HOME/bin/subl-handler <<EOF
#!/bin/bash
request=${1:23} # Delete the first 23 characters "subl://open?url=file://"
request=${request//%2F//} # Replace %2F with /
request=${request//%2f//} # Replace %2F with /
request=${request/&line=/:} # Replace &line= with :
View gist:1dca5bc832926d5532d0b81b45043d70
function base36($length = 10) {
$id = '';
$seed = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
while ($length--) {
$id .= $seed[mt_rand(0, 35)];
}
View gist:6d4c429fb46734d5d41d
alias gps='git push origin HEAD'
alias gam='git add -A ; git commit -a -m'
alias gc='git checkout'
alias gpu='git pull origin HEAD'
alias glog='git log --pretty=format:"%C(yellow)%h %ad%Cred%d %Creset%s%Cblue [%cn]" --decorate --date=short'
alias gf='git fetch --all'
View gist:06797c6236088c91d911
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
View gist:fbb26c7aaf2313cad944
alias cd..='cd ../'
alias ..='cd ../'
alias ...='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
alias .6='cd ../../../../../../'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
View gist:0f7b1964d84e0c05602a
PS1='\w `B=$(git branch 2>/dev/null | sed -e "/^ /d" -e "s/* \(.*\)/\1/"); if [ "$B" != "" ]; then S="git"; else S=""; fi; if [ "$S" != "" ]; then if [ "$B" != "" ]; then M=$S:$B; else M=$S; fi; fi; [[ "$M" != "" ]] && echo -n -e "\[\033[01;32m\]($M)\[\e[00m\]"` @ \h \n| => '
@wppd
wppd / gist:5494845
Created May 1, 2013
.htaccess form wp.tutsplus.com/tutorials/hosting/optimizing-wordpress-loading-speed-with-header-php-htaccess/
View gist:5494845
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
@wppd
wppd / gist:5080631
Created Mar 4, 2013
Create a dropdown list button in tinymce toolbar - js
View gist:5080631
(function() {
tinymce.create('tinymce.plugins.drop', {
init : function(ed, url) {
},
createControl : function(n, cm) {
if(n=='drop'){
var mlb = cm.createListBox('drop', {
title : 'drop',
@wppd
wppd / gist:5080625
Created Mar 4, 2013
reate a dropdown list button in tinymce toolbar
View gist:5080625
<?php
/*
Plugin Name: Tinymce Dropdown List Button
Plugin URI: http://www.wpactions.com
Description: Create a dropdown list button in tinymce toolbar
Author: Jesse
Version: 0.1
Author URI: http://www.wpactions.com/
*/
View gist:4958366
<?php
/*
Plugin Name: WPPD QR Code Generator
Plugin URI: http://www.wordpressplugindeveloper.com
Description: Create QR code generator for every post/page
Author: Jesse
Version: 1
Author URI: www.wordpressplugindeveloper.com
*/