Skip to content

Instantly share code, notes, and snippets.

@sveetch
sveetch / jquery.fpoimg.js
Created May 5, 2017 09:07
jQuery plugin to transform every <img> source to a fpoimg url with original natural image dimensions
/*
* jQuery plugin to transform every <img> source to a fpoimg url with original
* natural image dimensions, this won't work with SVG images nor background
* images.
*
* You should instanciate this plugin before everything else that manipulate
* images.
*
* Usage exemple:
*
@sveetch
sveetch / _flexbox_support.scss
Created May 26, 2015 15:06
SCSS mixins to add support for Flexbox prefixes for IE10
@import "compass/css3";
@import "compass/css3/shared";
// For more information see https://gist.github.com/cimmanon/727c9d558b374d27c5b6
// NOTE:
// -----
// All mixins for the @box spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the @box spec, but don't
@et4891
et4891 / accelerometer.js
Last active December 30, 2015 05:49
Canvas + Accelerometer *http://www.lonhosford.com/lonblog/* From html and simplified into only js file
var canvas_ctx; // HTML canvas 2d context
var ax = 0; // Acceleration x axis (Accelerometer value adjusted for direction)
var ay = 0; // Acceleration y axis (Accelerometer value adjusted for direction)
var x; // Circle x position
var y; // Circle y position
var vx = 0; // Velocity x axis
var vy = 0; // Velocity y axis
var WIDTH = 320; // Width of canvas
var HEIGHT = 300; // Height of canvas
var RADIUS = 10; // Width of circle object

CSS Flexbox: Specification Unification

The flexbox module has been kicking around for quite some time. There are 3 different specifications that have been implemented in the major browsers. This is an overview of how to cover all of them. If you're interested in how to use flexbox, there are many fine articles out there (some have been linked below).

Browsers

  • Chrome 21 (prefixed)
  • Opera 12.1 (unprefixed)
@sveetch
sveetch / fittext.scss
Last active December 12, 2015 04:18
A simple SCSS mixin to compute font size for each breakpoint.
// Strip unit from a number value
// Usage :
// strip-units(16px);
// Will return "16" (as a number)
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
// Write font-size rules for each given breakpoint, the font-size is calculated for each
// breakpoint
@mgvez
mgvez / jquery.abstractButton.js
Created November 20, 2012 22:05
Abstract jQuery button animation plugin
/**
A simple class to animate button rollovers with GreenSock GSAP.
Modified from its original version so as not to be loaded by require.js.
Author: Martin Vézina 2012 http://la-grange.ca
requires :
jQuery (http://jquery.com)
GSAP (http://www.greensock.com)
@mgvez
mgvez / jQuery.maskedSprite.js
Created November 8, 2012 20:35
jQuery plugin to transform spritesheets in Easel.js sprites
/**
jQuery maskedSprite plugin
Author: Martin Vézina 2012 http://la-grange.ca
requires :
imagesLoaded (http://github.com/desandro/imagesloaded)
easel (http://www.createjs.com)
Licensed under the MIT license
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active June 17, 2024 17:46
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User