Skip to content

Instantly share code, notes, and snippets.

View L1fescape's full-sized avatar

Andrew Kennedy L1fescape

View GitHub Profile
/*
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*/
(function(jQuery){
// We override the animation for all of these color styles
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
@L1fescape
L1fescape / GSplaylists.txt
Created July 15, 2011 17:47
Incase Marco deletes my shit
Happy - 39399974
Catherine The Waitress by Teitur (8760566)
Halloween by matt pond PA (7307951)
Burning by The Whitest Boy Alive (52878)
Elephant Gun by Beirut (1048627)
Bad Day by Darwin Deez (23388201)
Happy Banjo by Dark Mean (24778027)
Good Day [Andrew Maury Remix] by Jukebox the Ghost (9916087)
City Dreams by Antonio Paul (27537339)
Cala Cola by The smiles (27683257)
@L1fescape
L1fescape / Cornify...
Created November 12, 2012 04:18
...all the things!
function getScript(url, callback) {
var head = document.documentElement,
script = document.createElement("script");
script.src = url;
var done = false;
script.onload = script.onreadystatechange = function() {
if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) {
@L1fescape
L1fescape / snowjob.py
Last active December 10, 2015 02:48 — forked from sontek/snowjob.py
#!/usr/bin/env python
import os
import random
import time
import platform
snowflakes = {}
try:
# Windows Support
@L1fescape
L1fescape / JS for loop
Created December 26, 2012 17:54
Variation of a for loop in javascript I didn't know you could do.
var files = ["a","s","d","f"];
for (var i = 0, f; f = files[i]; i++) {
console.log(i, f);
}
@L1fescape
L1fescape / gist:4414186
Created December 30, 2012 18:03
Copying CSS
$.fn.copyCSS = function () {
var sheets = document.styleSheets,
o = {},
element = $(this[0]);
console.log(element)
for ( var i in sheets ) {
var rules = sheets[i].rules || sheets[i].cssRules;
for ( var r in rules ) {
if ( element.is(rules[r].selectorText) ) {
o = $.extend(o, css2json(rules[r].style), css2json(element.attr('style')));
@L1fescape
L1fescape / gist:4552562
Created January 17, 2013 00:57
Display files from a directory in Flask
@app.route('/photos/<photo_name>', methods = [ 'GET' ])
def photos(photo_name):
return send_from_directory("/path/to/photos", photo_name, as_attachment=False)
#!/bin/python
# Download DaVinci's Notebook from http://www.bl.uk/manuscripts/FullDisplay.aspx?ref=Arundel_MS_263
#
# Format is:
# http://www.bl.uk/manuscripts/Proxy.ashx?view=arundel_ms_263_<page_number>_files/<resolution_level>/<column>_<row>.jpg
#
# Pages work in this fashion: f001r, f001v, f002r, f002v, f003r, f003v, ... and ends at f283v.
# At resolution 14, columns range from 0 to 33 and rows range from 0 to 24.
@L1fescape
L1fescape / arduino_demux_pot.cpp
Created February 25, 2013 02:19
Code from Arduino Demultiplexer and Potentiometer video http://youtu.be/tRjOoweOEaU
int sensorPin = A0;
int delayAmt = 0;
int led = 13; //just a led
void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
@L1fescape
L1fescape / vim splits
Created April 19, 2013 00:15
My settings for splitting in vim
" Splits
" switching splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" resizing splits
map = <c-w>+
map - <c-w>-
map + <c-w><