Skip to content

Instantly share code, notes, and snippets.

View genoma's full-sized avatar

Alessandro Vioni genoma

View GitHub Profile
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is free to use by anyone (MIT, blabla).
// Original Author: rkorving@wizcorp.jp
var timeouts = {};
var intervals = {};
var orgSetTimeout = window.setTimeout;
var orgSetInterval = window.setInterval;
// http://stackoverflow.com/questions/2450954/how-to-randomize-a-javascript-array
// SHUFFLE ARRAY
function shuffle(array) {
var currentIndex = array.length,
temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
browser = ->
val = navigator.userAgent.toLowerCase()
if val.indexOf("firefox") > -1
browser = 'firefox'
else if val.indexOf("chrome") > -1
browser = 'chrome'
else if val.indexOf("opera") > -1
browser = 'opera'
else if val.indexOf("msie") > -1
browser = 'ms'
@genoma
genoma / jquery-plugin.coffee
Last active December 23, 2015 10:39
Basic jquery plugin template for coffeescript
# Reference jQuery
$ = jQuery
# Adds plugin object to jQuery
$.fn.extend
# Change pluginName to your plugin's name.
pluginName: (options) ->
# Default settings
settings =
option1: true
@genoma
genoma / slider-responsive.coffee
Created September 20, 2013 13:36
Slider Responsive
# Reference jQuery
$ = jQuery
# Adds plugin object to jQuery
$.fn.extend
# Change pluginName to your plugin's name.
responsiveSlider: (options) ->
# Default settings
settings =
debug: false
@genoma
genoma / supportTransitions
Last active December 24, 2015 21:59
Check browser support for CSS3 transitions
supportsTransitions = ->
docBody = document.body or document.documentElement
styles = docBody.style
prop = "transition"
return true if typeof styles[prop] is "string"
# Tests for vendor specific prop
vendor = ["Moz", "Webkit", "Khtml", "O", "ms"]
prop = prop.charAt(0).toUpperCase() + prop.substr(1)
i = undefined
@genoma
genoma / safary-font-fix.sass
Last active December 25, 2015 16:19
Fix for Safari fonts going crazy with css3 transitions and absolute/fixed elements (SASS)
// FIX FOR SAFARI FONTS GOING CRAZY WITH TRANSITIONS AND FIXED ELEMENTS
body
-webkit-font-smoothing: subpixel-antialiased
-webkit-transform: translateZ(0)
@genoma
genoma / Gruntfile.js
Created February 27, 2014 12:11
Grunt configuration for Foundation 5 with coffeescript and grunt-newer
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compileJoined: {
options: {
join: true
},
files: {
'js/app.js': ['coffeescripts/app.coffee', 'coffeescripts/*.coffee']
#!bin/bash
make clean
make distclean
./configure --enable-multibyte --with-tlib=ncurses --with-features=huge --enable-rubyinterp --enable-luainterp --enable-pythoninterp --with-lua-prefix=/usr/local --enable-gui=no --without-x --disable-netbeans --with-compiledby=jenoma@gmail.com --enable-fail-if-missing
@genoma
genoma / configure.sh
Last active August 29, 2015 13:57
Compile Vim official source with MacPort python on Mac OSX correctly (vim/src/auto/configure)
# LINE 5781 change with
# then proceed as usual after a make distclean
vi_cv_path_python_plibs="-F/opt/local/Library/Frameworks -framework Python"