Skip to content

Instantly share code, notes, and snippets.

View folletto's full-sized avatar

Erin Casali folletto

View GitHub Profile
@folletto
folletto / package.json
Last active August 29, 2015 13:59
Basic package.json
{
"name": "hello",
"version": "0.0.1",
"dependencies": {
"jade": "*"
}
}
@folletto
folletto / APICaller.gs
Created May 5, 2014 18:28
Custom Google Spreadsheet function to call a JSON REST endpoint.
/*
* Google Spreadsheet Custom Functions
* Latest Update: 2014-05-05
*
* Usage: drop this in a Spreadsheet -> Tools -> Script Editor...
*
*/
function getJSON(jpath, url) {
@folletto
folletto / gist:c1129135a1fe71fd9aff
Last active August 29, 2015 14:03
The Black Shaded 3D(x) Wireframe Effect
// Open a website. Open the Inspector. Got to the Console. Paste the following:
// First this
(function(){var jQueryVersion="2.1.1";var a=document.createElement("script");a.src="//ajax.googleapis.com/ajax/libs/jquery/"+jQueryVersion+"/jquery.js";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a);})()
// Then this (the first one needs time to load)
$("*").css("border", "0");
$("*").css("color", "rgba(0,0,0,0)");
$("*").css("background", "rgba(255, 255, 255, 0.1)");
@folletto
folletto / .bash_profile
Created July 15, 2014 17:57
Shell: Blue Arrow with GIT Branch
# Prompt
function makeprompt() {
# http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux
local TBLUE="\[\e[0;34m\]"
local TCYAN="\[\e[0;36m\]"
local TLIGHT_CYAN="\[\e[1;36m\]"
local TGRAY_DARK="\[\e[1;30m\]"
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
@folletto
folletto / GoogleSpreadsheet.APICaller.gs
Created July 21, 2014 10:16
Google Spreadsheet Custom Functions: getJSON(jpath, url)
/*
* Google Spreadsheet Custom Functions
* Latest Update: 2014-05-05
*
* Usage: drop this in a Spreadsheet -> Tools -> Script Editor...
*
* Then in any cell, use call with this format:
* =getJSON("key", "https://public-api.example.com/v1/resource/234")
*
*/
@folletto
folletto / gist:db74ab3da8fb919823ae
Created October 26, 2014 17:45
Keybase.io Auth
### Keybase proof
I hereby claim:
* I am Folletto on github.
* I am folletto (https://keybase.io/folletto) on keybase.
* I have a public key whose fingerprint is EC5C 54B7 8897 D3F4 8B83 1801 15C7 2591 8A62 0557
To claim this, I am signing this object:
@folletto
folletto / mixin-ring-hover.scss
Last active August 29, 2015 14:10
SASS: Simple :hover animation mixin
/**
* Simple ring hover animation
*/
@mixin menus-hover-halo() {
position: relative;
&:after {
content: "";
pointer-events: none;
position: absolute;
@folletto
folletto / functions.php
Created January 11, 2015 21:22
WordPress: Create a Custom Loop for Related Posts
<?php
/*
* Notes:
* 1. This isn't an universal function: you might have to add your own db field.
* I tried to keep just a few to optimize.
* 2. This is a more advanced function from the ones you usually find around, because it
* count the number of matching tags to sort the related articles, doesn't just query
* and sort for the most recent one with any of the tags.
*/
@folletto
folletto / walk-recursive-flatten-copy.js
Last active August 29, 2015 14:16
Script to iterate a directory structure and do stuff
#!/usr/bin/env node
/*
* General folder iterator plus filtering functions.
* Copyright (2015) Davide 'Folletto' Casali
* Released under GPLv2 License.
*
* USAGE:
* node move-flatten.js jpg ./from/ ./to/
*/
#!/usr/bin/php
<?php
function getAllDirectories( $base_dir, $list_hidden = false ) {
$out = array();
foreach ( new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_dir ) ) as $path ) {
// ****** Skip non-relevant files
$filename = basename( $path );