Skip to content

Instantly share code, notes, and snippets.

@ahmedam55
ahmedam55 / gist:183ac065be9b7dd2ce5f
Created Jan 2, 2015
SPA problem with setIntervals and animation
View gist:183ac065be9b7dd2ce5f
for(var i=0;i<99999;i++){
clearInterval(i);
clearTimeout(i);
}
View gist:37ae4c573f34e167dd29
##Employee
- [ ] for an empty checkbox
- [x] for a checked checkbox
View gist:3a78cd724cd3a248d2b0

##Employee

  • for an empty checkbox ###Employee
    • for a checked checkbox
  • for a checked checkbox
View Open with Sublime file and Folder.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Submlie]
@="Open with Sublime"
"Icon"="C:\\Program Files (x86)\\Sublime Text 3\\sublime_text.exe"
[HKEY_CLASSES_ROOT\*\shell\Submlie\command]
@="C:\\Program Files (x86)\\Sublime Text 3\\sublime_text.exe \"%1\""
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script src="scripts.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
View index.js
var fs = require('fs');
var readline = require('readline');
var imageDiff = require('image-diff');
var exec = require('child_process').exec;
var createRefrenceImages = false;
var urls = [
'https://jsbin.com/yutoho',
'https://jsbin.com/toruge'
View create-screenshots.js
var page = require('webpage').create();
var system = require('system');
var setExpected = system.args[2] == '-set-expected';
var imagesFolder = setExpected ? 'expected' : 'new';
var urlsAndBreakpoints = system.args[1];
var urls = urlsAndBreakpoints.split('-')[0].split(',');
var viewports = urlsAndBreakpoints.split('-')[1].split(',');
var viewportsObjects = [];
View package.json
{
"name": "diff",
"version": "1.0.0",
"description": "",
"main": "diff.js",
"scripts": {
"test": "node test"
},
"keywords": [],
"author": "",
View snap-svg.js
var svg = document.getElementById("cups");
var s = Snap(svg);
var simpleCup = Snap.select('#simple-cup');
var fancyCup = Snap.select('#fancy-cup');
var simpleCupPoints = simpleCup.node.getAttribute('d');
var fancyCupPoints = fancyCup.node.getAttribute('d');
var toFancy = function(){
simpleCup.animate({ d: fancyCupPoints }, 1000, mina.backout, toSimple);
}
var toSimple = function(){