Skip to content

Instantly share code, notes, and snippets.

View ahmetvurgun's full-sized avatar

Ahmet Vurgun ahmetvurgun

View GitHub Profile
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!
# Go to dropbox.com/developers/apps to create an app.
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
# access_type can be 'app_folder' or 'dropbox', depending on
# how you registered your app.
access_type = 'app_folder'
@vermilion1
vermilion1 / timer.js
Created August 21, 2014 17:44
Advanced timer with ability to pause/resume the callback
/**
* Advanced timer with ability to pause/resume the callback.
* @param {function} callback - Callback to be executed after some delay.
* @param {number} delay - Delay.
* @returns {Object} Timer object with useful methods.
*/
var timer = function (callback, delay) {
var isPaused = true;
var timer, start, clear, pause, resume;