Skip to content

Instantly share code, notes, and snippets.

View LiamChapman's full-sized avatar

Liam Chapman LiamChapman

View GitHub Profile
@tbrd
tbrd / gulpfile.js
Last active August 29, 2015 13:56
Gulp hogan compile task
'use strict';
var gulp = require('gulp');
var refresh = require('gulp-livereload');
var livereload = require('tiny-lr');
var server = livereload();
var concat = require('gulp-concat');
var hogan = require('gulp-hogan-compile');
gulp.task('livereload-server', function () {
@xadhix-zz
xadhix-zz / Facebook Lookback Downloader
Created February 4, 2014 12:18
Extracts the HD video link from the Facebook lookback page.
var xLBD = {};
xLBD.c = function (){
xLBD.f = unescape(document.querySelector("[flashvars]").getAttribute("flashvars")).substring(7);
xLBD.f = JSON.parse(xLBD.f.substring(0, xLBD.f.lastIndexOf("}") + 1)).video_data[0].hd_src;
xLBD.a = "<div style='position:absolute;top:100px;height:300px;left:15%;background:#fff;border:10px solid #000;font-size:5em;padding:100px;'>Click <a download='lookback.mp4' href='"+xLBD.f+"'>here<\/a> to download your lookBack video.</div>";
document.body.innerHTML += xLBD.a;
}
if(document.readyState == "complete")
xLBD.c();
else window.onload = xLBD.c;
@akatzbreaker
akatzbreaker / AnimetricsAPI.py
Created January 18, 2014 23:21
Animetrics API Wrapper for Python. Face Recognition Made Easy! :) Every Method from the API is Included!
import urllib
import urllib2
try:
import json
except:
import simplejson as json
# First, Get your API Key for free from: api.animetrics.com
# See at the very below section for HOWTO.
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@dr-dimitru
dr-dimitru / .htaccess
Created October 30, 2013 16:34
.htaccess file for Laravel 4 and Laravel 3 | For /public folder
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
TEMPLATE_CONTEXT_PROCESSORS = (
...
'app.context_processors.global_settings',
)
from django.conf import settings
def global_settings(request):
# return any necessary values
return {
'GOOGLE_ANALYTICS': settings.GOOGLE_ANALYTICS,
'GOOGLE_API_KEY': settings.GOOGLE_API_KEY
}
function drawMouseSpeedDemo() {
var mrefreshinterval = 500; // update display every 500ms
var lastmousex=-1;
var lastmousey=-1;
var lastmousetime;
var mousetravel = 0;
var mpoints = [];
var mpoints_max = 30;
$('html').mousemove(function(e) {
var mousex = e.pageX;
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active June 15, 2026 06:29
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================