Skip to content

Instantly share code, notes, and snippets.

View smithcommajoseph's full-sized avatar

Joseph (Jos) Smith smithcommajoseph

View GitHub Profile
@smithcommajoseph
smithcommajoseph / app.vcl
Created October 27, 2011 21:40
Sample Localhost VCL config for Varnish 3 and Rails 3.1
#-e This is a basic VCL configuration file for varnish. See the vcl(7)
#man page for details on VCL syntax and semantics.
#
#Default backend definition. Set this to point to your content
#server.
#
backend default {
.host = "127.0.0.1";
.port = "3000";
}
@smithcommajoseph
smithcommajoseph / feature_server.profile
Created November 2, 2011 16:35
D6 feature server Drush makefile + install profile
<?php
/**
* Return a description of the profile for the initial installation screen.
*
* @return
* An array with keys 'name' and 'description' describing this profile.
*/
function feature_server_profile_details() {
return array(
@smithcommajoseph
smithcommajoseph / post
Created March 22, 2012 04:14
git-upload-pack
[remote "origin"]
url = <the repo address>
fetch = +refs/heads/*:refs/remotes/origin/*
uploadpack = <path to git-upload-pack>
receivepack = <path to git-receive-pack>
@smithcommajoseph
smithcommajoseph / stops.js
Created March 22, 2012 04:50
MTA Subway JS ex
{ "Stops" : [
{
"slocation" : "Astoria Ditmars Blvd",
"transfer" : [ "W" ],
"access" : " "
},
{
"slocation" : "Astoria Blvd",
"transfer" : [ "W" ],
"access" : " "
@smithcommajoseph
smithcommajoseph / dump.mysql
Created March 26, 2012 23:19
Skip phpMyAdmin and dump your DB using terminal commands
mysqldump -u DATABASE_USER -p -h HOST DATABASE_NAME > FILE.sql
@smithcommajoseph
smithcommajoseph / email_template.css
Created March 26, 2012 23:25
EMAIL TEMPLATE TIPS
body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
font-weight: inherit;
font-style: inherit;
line-height: 1;
font-family: inherit;
@smithcommajoseph
smithcommajoseph / train.actions.js
Created March 26, 2012 23:36
MTA-STYLE TRAIN STOP LIST
var mta = {}; //simple object w/ a few properties
mta.visibleStops = 10; //10 visible items/stops at time
mta.unformattedStops = []; // will hold the FULL array of stops
mta.formattedStops = []; // will hold the formatted array of stops
mta.sint = 0; //starting int
//wrapper function that calls everything else
mta.startTrain = function(){
//format if not already formatted
if($('#next').children().length === 0){
@smithcommajoseph
smithcommajoseph / .my.cnf
Created March 26, 2012 23:45
MAMP Mysql from the command-line
[client]
user="root"
pass="root"
port=8889
socket="/Applications/MAMP/tmp/mysql/mysql.sock"
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
function superprompt {
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
export PS1="\[\e]2;\u@\h\a[\[\e[37;44;1m\]\t\[\e[0m\]]$RED\$(parse_git_branch) \[\e[32m\]\W\[\e[0m\] \$ "
PS2='> '
@smithcommajoseph
smithcommajoseph / extendsVsextend.js
Created September 16, 2012 18:32
js extends vs extend
//A rough demo of extends vs extend
/*
* Extends - the second object needs to already be initialized
* after that, it will extend the first object
*
* var o1 = {"a": 1, "b": 2};
* var o2 = {};
* o2.extends(o1);
*/