Skip to content

Instantly share code, notes, and snippets.

View seafoox's full-sized avatar

Alexandre Collin seafoox

View GitHub Profile
@seafoox
seafoox / script.js
Last active December 21, 2015 03:59
Textfill Module // auto font resize based on the parent width
// Textfill Module
// ----------------
// auto font rezize based on the parent size
//
(function($, window) {
var initialFontSize = null;
$.fn.textfill = function(maxFontSize)
{
maxFontSize = parseInt(maxFontSize, 10);
@seafoox
seafoox / index.html
Created August 15, 2013 01:12
Defer loading of social script after onload --- URL: http://www.aaronpeters.nl/blog/why-loading-third-party-scripts-async-is-not-good-enough The loading of JS social buttons its deferred until onload event its fired.
<script>
(function(w, d, s) {
function go(){
var js, fjs = d.getElementsByTagName(s)[0], load = function(url, id) {
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.src = url; js.id = id;
fjs.parentNode.insertBefore(js, fjs);
};
load('//connect.facebook.net/en_US/all.js#appId=272697932759946&xfbml=1', 'fbjssdk');
load('https://apis.google.com/js/plusone.js', 'gplus1js');
@seafoox
seafoox / SublimeLinter.sublime-settings
Created November 26, 2012 11:02
SublimeLinter Configuration
{
// If true, when the file is saved any errors will appear in a popup list
"sublimelinter_popup_errors_on_save": false,
// Javascript linter: "gjslint" to use the closure javascript linter (if available),
// or either "jshint" or "jslint" to use a built in linter.
"javascript_linter": "jshint",
// jshint: options for linting JavaScript. See http://www.jshint.com/options/ for more info.
@seafoox
seafoox / rAF.js
Created November 3, 2012 22:57 — forked from paulirish/rAF.js
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
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@seafoox
seafoox / HowTo_SublimeText2_Terminal_MacOSX
Created April 20, 2012 15:55
Launch SublimeText2 from the Terminal
## Launch SublimeText2 from the Terminal (on MacOS X) ##
1/ Open Terminal.app
2/ Copy/paste the following symbolic link. You can replace 'subl' at the end with the keyword of your choice
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
3/ Now you can open files and projects directly from the Terminal
- Open the current folder as a project: "subl ."
- Open a file "subl _PATH_/file.js"