Skip to content

Instantly share code, notes, and snippets.

View soundstep's full-sized avatar
💭
There is a difference between a peasant and a knight

Romuald Quantin soundstep

💭
There is a difference between a peasant and a knight
View GitHub Profile
╰─$ mocha allTests.js --reporter spec --framework=angularjs 26 ↵
TodoMVC - angularjs
No Todos
✓ should hide #main and #footer (93ms)
New Todo
1) should allow me to add todo items
2) should clear text input field when an item is added
3) should append new items to the bottom of the list
@soundstep
soundstep / dabblet.css
Created May 11, 2012 11:53 — forked from anonymous/dabblet.css
css buttons
.button
{
display: inline-block;
white-space: nowrap;
background-color: #ccc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ccc));
background-image: -webkit-linear-gradient(top, #eee, #ccc);
background-image: -moz-linear-gradient(top, #eee, #ccc);
background-image: -ms-linear-gradient(top, #eee, #ccc);
background-image: -o-linear-gradient(top, #eee, #ccc);
@soundstep
soundstep / javascript hash map
Created October 27, 2012 17:22
javascript hash map
var HashMap = function(){
var uuid = function(a,b){for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');return b;}
var getKey = function(target) {
if (!target) return;
if (typeof target !== 'object') return target;
return target.hashkey ? target.hashkey : target.hashkey = uuid();
}
return {
put: function(key, value) {
this[getKey(key)] = value;
.square {
width: 100px;
height: 100px;
background: red;
margin: 5px;
}
.animated {
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
.square {
width: 100px;
height: 100px;
background: red;
margin: 5px;
}
.animated {
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
div {
background-color: #ccc;
margin: 20px;
width: 50px;
height: 50px;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: ease-out;
}
@soundstep
soundstep / package.json
Created August 15, 2013 18:57
Auto install (preinstall) grunt-cli from package.json
{
"name": "Project name",
"version": "0.0.0",
"author": "Author name",
"scripts": {
"preinstall": "which -s grunt && grunt --version | grep grunt-cli > /dev/null 2>&1; if [[ \"$?\" != 0 ]]; then npm install grunt-cli -g; exit 0; fi"
},
"devDependencies": {
"grunt": "~0.4.1"
}
@soundstep
soundstep / 0_reuse_code.js
Created November 27, 2013 17:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@soundstep
soundstep / gist:8041814
Last active December 31, 2015 20:39
soma several instance (coupon example)
// Code goes here
window.widgets = window.widgets || {};
window.widgets.coupons9 = window.widgets.coupon9 || {};
(function(ns, soma) {
'use strict';
var CouponsMediator = function(target, dispatcher, dataService, couponsTemplate) {
@soundstep
soundstep / gist:7774021
Created December 3, 2013 17:50
Javascript linked list (reverse)
var Node = function(data, next) {
this.data = data;
this.next = next;
};
var node1 = new Node('id1',
new Node('id2',
new Node('id3',
new Node('id4')
)