Skip to content

Instantly share code, notes, and snippets.

@mrosati84
mrosati84 / drag_to_upload.js
Last active August 29, 2015 14:06
A super-simple jQuery plugin that handles drag-to-upload files
(function(window, document, $) {
'use strict';
if ( ! String.hasOwnProperty('hashCode') ) {
/**
* returns a hash code from a base string
* @return {string}
*/
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@ifthenelse
ifthenelse / fb-batch-dl.html
Last active December 25, 2015 17:09
Script that lists the images of a Facebook user, separated by album, using OpenGraph API. Just provide the target Facebook user id. Original code by Nicola de Lazzari. Thanks to Enrico Vedovo.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Facebook batch photo download</title>
<meta name="description" content="This script will hopefully last longer than other apps. At lest until FB will change their damnd API again">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
@bennadel
bennadel / index.htm
Created February 28, 2013 14:23
Grouping Nested ngRepeat Lists In AngularJS
<!doctype html>
<html ng-app="Demo" ng-controller="DemoController">
<head>
<meta charset="utf-8" />
<title>
Grouping Nested ngRepeat Lists In AngularJS
</title>
</head>
<body>
@atk
atk / ie10hack.css
Created November 6, 2012 14:43
IE10 hack
/*
#ie10 will only be red in MSIE 10,
both in high contrast (display setting) and default mode
*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#ie10 { color: red; }
}
@mrosati84
mrosati84 / Preferences.sublime-settings
Last active October 12, 2015 04:47
My Sublime Text 2/3 Settings
{
"binary_file_patterns":
[
"*.scssc"
],
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Colorsublime/themes/Boron.tmTheme",
"draw_white_space": "all",
"fade_fold_buttons": false,
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];