Skip to content

Instantly share code, notes, and snippets.

@ucavus
ucavus / _container-switch.scss
Last active November 25, 2015 03:02
Enables switching between fluid and fixed layout containers based on screen width media queries, in bootstrap 3.
/*! Container Switch, Copyright 2015 ucavus, Licence: MIT (https://opensource.org/licenses/MIT) */
@each $cs-size, $cs-screen
in (
sm: (
min: $screen-sm-min,
width: $container-sm
),
md: (
min: $screen-md-min,
width: $container-md
@ucavus
ucavus / shake.js
Last active November 18, 2018 14:18 — forked from leecrossley/shake.js
Detect shake gestures in Cordova (Phonegap).
/*
The only required option is the "success" callback. Usage:
var shake = new Shake({
frequency: 300, //milliseconds between polls for accelerometer data.
waitBetweenShakes: 1000, //milliseconds to wait before watching for more shake events.
threshold: 12, //how hard the shake has to be to register.
success: function(magnitude, accelerationDelta, timestamp) {}, //callback when shake is detected. "this" will be the "shake" object.
failure: function() {}, //callback when watching/getting acceleration fails. "this" will be the "shake" object.
});