Skip to content

Instantly share code, notes, and snippets.

@ganglio
ganglio / ganglio.zsh-theme
Created January 25, 2013 17:22
ZSH: Prompt Theme
##Ganglio theme
# A couple of definition
OPEN_SQUARE="%{$reset_color%}%{$fg[cyan]%}[%{$reset_color%}"
CLOSE_SQUARE="%{$reset_color%}%{$fg[cyan]%}]%{$reset_color%}"
TL_ANGLE="%{$reset_color%}%{$fg[cyan]%}┌%{$reset_color%}"
BL_ANGLE="%{$reset_color%}%{$fg[cyan]%}└%{$reset_color%}"
V_BAR="%{$reset_color%}%{$fg[cyan]%}│%{$reset_color%}"
VR_BAR="%{$reset_color%}%{$fg[cyan]%}├%{$reset_color%}"
AT_SIGN="%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}"
@ganglio
ganglio / gist:4464968
Created January 6, 2013 03:08
JS: $ shortcut to querySelectorAll
function $(expr, con) {
return [].slice.call((con || document).querySelectorAll(expr));
}
@ganglio
ganglio / fb.js
Created December 13, 2012 14:39
CasperJS: Facebook photos scraper
var casper = require('casper').create({
verbose : true,
logLevel : 'info'
});
var images = [];
var fs=require("fs")
/**
* Configuration here
*/
@ganglio
ganglio / gist:4234793
Created December 7, 2012 17:16
Satsuma Logo
.logo {
border: 10px solid orange;
width: 100px;
height: 100px;
border-radius: 40px;
position: relative;
box-sizing: border-box;
color: black;
}
.logo:before {
@ganglio
ganglio / gist:3959897
Created October 26, 2012 16:56
SCSS: Ruler Mixin
@mixin ruler($width:50px,$height:10px) {
background: {
color: black;
clip: content-box;
}
border: {
width: $height 1px;
style: solid;
color: transparent black;
};
@ganglio
ganglio / gist:3932695
Created October 22, 2012 17:13
SCSS: hr ruler
hr {
height: 10px;
@include background-image
(linear-gradient(left, black 1%, transparent 1%),
linear-gradient(left, black 2%, transparent 2%),
linear-gradient(left, black 10%, transparent 10%),
linear-gradient(left, black 20%, transparent 20%),
linear-gradient(top, transparent 5px, black 5px, transparent 6px));
border: none;
background-position: 0px 50%, 0px 50%, 0px 50%, 0px 50%, 0px 0;
@ganglio
ganglio / config.rb
Last active October 10, 2015 16:07
Compass: single folder configuration file
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "/"
fonts_dir = "/"
sass_dir = "/"
images_dir = "/"
javascripts_dir = "/"
@ganglio
ganglio / gist:3638373
Created September 5, 2012 15:25
SCSS: Tassels Mixin
@mixin tassels($color:#ffffff,$size:20px) {
position: relative;
&:before {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: $size;
background-size: $size $size*2;
@ganglio
ganglio / gist:3635646
Created September 5, 2012 12:02 — forked from grammaticof/gist:3635239
JS - Mobile redirect
function mobile_redirect() {
var path = window.location.pathname;
if (path != null) {
window.location = 'http://host' + path
} else {
window.location = 'http://host/'
}
}
function setCookie(c_name, value, expiredays) {
var exdate = new Date();
@ganglio
ganglio / gist:3613852
Created September 3, 2012 21:50
iTunes Festival Apply Script
<?php
$email="robertotorella";
for ($i=3; $i<100; /*8192;*/ $i++) {
$bin=strrev(str_pad(decbin($i), 13,'0',STR_PAD_LEFT));
$apply_address=addDot($email,$bin);
$st=time();
echo "Applying $apply_address ($i)\n";
$res = apply($apply_address)?"Successfully":"Not successfully";