Skip to content

Instantly share code, notes, and snippets.

View fitsum's full-sized avatar
💭
npx fitsum

ፍፁም fitsum

💭
npx fitsum
View GitHub Profile
@fitsum
fitsum / _grid-base.sass
Created January 20, 2012 20:52
Fluid Desktop & Mobile Grid
// This file requires Sass & Compass.
//
// - http://sass-lang.com
// - http://compass-style.org
// For box-sizing.
@import compass/css3
// `Clear floated elements.
//----------------------------------------------------------------------------------------------------
@fitsum
fitsum / grep_dir
Created July 9, 2013 20:52
recursive directory search for file with line containing "mail("
egrep -ir --include=*.{php,html,js} "mail\(" .
<script type="text/javascript">
$(document).ready(function(){
$('a').on('click',function(){
var $href = $(this).attr('href');
var $pptDoc = new RegExp(".ppt$").test($href);
var $wordDoc = new RegExp(".doc$").test($href);
var $pdfDoc = new RegExp(".pdf$").test($href);
var $docType;
function push2GA(thisURL,thisOptValue){
_gaq.push(['_trackEvent', 'Download', thisURL, thisOptValue]);
@fitsum
fitsum / LOL in binary
Last active December 28, 2015 15:19
"LOL" en binaire -- http://bit.ly/XceX
01101100
01101111
01101100
@fitsum
fitsum / git-vlog
Created November 18, 2013 16:48 — forked from asabaylus/git-vlog
# Git visual log displays commit tree view with who did what when and in which branch
git config --global alias.vlog 'log --graph --date-order --date=relative --pretty=format:"%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n" --color'
@fitsum
fitsum / sed find|replace in line beginning with ...
Last active August 29, 2015 13:57
sed find line beginning w/ A replace `B` with `C ` in file D. OS X requires back up file to be set
sed -i .bak '/^A/s/B/C' D
@fitsum
fitsum / Access Control - Allow Origin
Created May 18, 2014 20:16
Access Control - Allow Origin
# .htaccess
#
# single
Header set Access-Control-Allow-Origin "*"
# multiple
Header add Access-Control-Allow-Origin "domain1"
Header add Access-Control-Allow-Origin "domain2"
Header add Access-Control-Allow-Origin "domain3"
@fitsum
fitsum / Bash random numbers
Last active August 29, 2015 14:01
Bash random numbers
# generate random intiger
$((RANDOM))
# get random integer no less than 1
$(((RANDOM%10)+1))
@fitsum
fitsum / PHP menu maker
Created June 12, 2014 15:33
Lists files & directories recursively
// lists files & directories recursively
<?
function menu($dir){
$files = glob($dir.'/*');
$html = '<ul>';
foreach($files as $file){
if(is_dir($file)){
// FB 6/12
// added bc it wasn't tharr
@fitsum
fitsum / keybase.md
Created July 14, 2014 19:32
keybase.md

Keybase proof

I hereby claim:

  • I am fitsum on github.
  • I am fitsum (https://keybase.io/fitsum) on keybase.
  • I have a public key whose fingerprint is 4BD8 4239 0E39 19EC 98A3 2C3C AB54 C36F 9A94 8A70

To claim this, I am signing this object: