Skip to content

Instantly share code, notes, and snippets.

View elzii's full-sized avatar

Alexander Zizzo elzii

View GitHub Profile
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'
@elzii
elzii / wgc.sh
Created December 2, 2013 21:37
WGET Walkthrough Bash Scripts
#!/bin/bash
# DEFAULTS
#=========================================
WGETDIRNAME="wget"
# WGETDEFAULTDIR="/Users/`whoami`/Dropbox/Development/$WGETDIRNAME"
WGETDEFAULTDIR="/Users/`whoami`/$WGETDIRNAME"
# REV=""
# L=""
# NP=""
@elzii
elzii / header_example.php
Created December 11, 2013 23:25
// email components $data_cf_email = '__EMAILADDRESS__'; $headers = 'From: Imagination Foundation <[email protected]>' . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=utf-8\r\n"; $subject = 'Your event __EVENT NAME__ has been created!'; $message = ''This is the email content'; // mail it out wp_m…
<?php
// email components
$data_cf_email = '__EMAILADDRESS__';
$headers = 'From: Imagination Foundation <[email protected]>' . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
$subject = 'Your event __EVENT NAME__ has been created!';
$message = ''This is the email content';
@elzii
elzii / addthis_ajax_fix.js
Last active January 3, 2016 15:09
addthis ajax fix
/*
Addthis JS Fix
--------------
Assumes content lives in partial/content that is being loaded by an AJAX call
*/
// set addthos_config obj
var addthis_config = addthis_config||{};
// set the pubid to config obj
addthis_config.pubid = '__YOUR_PUBID__';
@elzii
elzii / so_node_modules.md
Last active January 4, 2016 07:29
S.O Nodejs Modules for consideration
@elzii
elzii / chrome_fix.js
Created March 27, 2014 19:21
Chrome "Invisible Font" fix
!(function ($) {
// user-agent && user-agent helper methods
var ua = navigator.userAgent;
var regex_apple_webkit = new RegExp(/AppleWebKit\/([\d.]+)/);
var result_apple_webkit_regex = regex_apple_webkit.exec(ua);
var apple_webkit_version = (result_apple_webkit_regex === null ? null : parseFloat(regex_apple_webkit.exec(ua)[1]));
// global variables
var GLOBALS = {
@elzii
elzii / leahslider.js
Created May 6, 2014 18:59
leah slider
var tot = images.length,
c = 0, // current image (array key index)
duration = 150,
$hero_image = $('.hero-image'),
$slide_cap = $('#slideCaption');
function initSlide(){
$hero_image.css('background-image', images[c]);
$slide_cap.html(captions[c]);
}
@elzii
elzii / index.js
Created August 19, 2014 20:42
requirebin sketch
// example using the raf module from npm. try changing some values!
var markdown = require('markdown').markdown;
var $ = require('jquery');
var canvas = document.createElement("canvas");
$.ajax({
url: 'https://api.github.com/repos/ruipgil/scraperjs/contents/README.md',
type: 'GET',
})
if(typeof jQuery == 'undefined') {
console.log('%cERROR', 'color:red', ' - jQuery not found.')
} else {
var App;
!(function ($) {
"use strict";
@elzii
elzii / mario.css
Created January 5, 2015 21:29
mario css
.mario {
width: 1em;
height: 1em;
z-index: 999999999999999;
position: fixed;
left: 50%;
margin-left: -2em;
bottom: 15em;
-webkit-box-shadow: 1em 0em 0em 0em #f83800, 2em 0em 0em 0em #f83800, 3em 0em 0em 0em #f83800, 4em 0em 0em 0em #f83800, 5em 0em 0em 0em #f83800, 0em 1em 0em 0em #f83800, 1em 1em 0em 0em #f83800, 2em 1em 0em 0em #f83800, 3em 1em 0em 0em #f83800, 4em 1em 0em 0em #f83800, 5em 1em 0em 0em #f83800, 6em 1em 0em 0em #f83800, 7em 1em 0em 0em #f83800, 8em 1em 0em 0em #f83800, 0em 2em 0em 0em #af7f00, 1em 2em 0em 0em #af7f00, 2em 2em 0em 0em #af7f00, 3em 2em 0em 0em #ffa347, 4em 2em 0em 0em #ffa347, 5em 2em 0em 0em #af7f00, 6em 2em 0em 0em #ffa347, -1em 3em 0em 0em #af7f00, 0em 3em 0em 0em #ffa347, 1em 3em 0em 0em #af7f00, 2em 3em 0em 0em #ffa347, 3em 3em 0em 0em #ffa347, 4em 3em 0em 0em #ffa347, 5em 3em 0em 0em #af7f00, 6em 3em 0em 0em #ffa347, 7em 3em 0em 0em #ffa347, 8em 3em 0em 0em #ffa347, -1em 4em 0em 0em #af7f00, 0em 4em 0em 0em #ffa347, 1em 4em 0em 0em #af7f00, 2em 4em 0em 0em