Skip to content

Instantly share code, notes, and snippets.

View davidtorroija's full-sized avatar
🏠
Working from home

David davidtorroija

🏠
Working from home
View GitHub Profile
@davidtorroija
davidtorroija / wercker-config-nightwatch-mocha.yml
Created April 11, 2016 21:46
Wercker CI config file to run in a Node Box: nightwatch with mocha, firefox and a custom nightwatch.json that differs from the dev file, also installs java to run selenium
box: node
build:
steps:
- script:
name: setup
code: |
sudo apt-get update -y -qq
- install-packages:
packages: ruby ruby-dev bzr mercurial git wget
- script:
@pascalduez
pascalduez / SassMeister-input.scss
Last active December 20, 2023 20:38
Some Sass string functions: capitalize, ucwords, camelize, ...
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Capitalize string
// --------------------------------------------------------------------------------
// @param [string] $string
// --------------------------------------------------------------------------------
// @return [string]
@therealplato
therealplato / stack-auth-bounce.js
Created December 17, 2013 00:38
Bouncing a user back to their last place after authentication with Express 3
// Bouncing a user back to their last place after authentication with Express 3
// To accompany http://stackoverflow.com/a/12443844/1380669
// by therealplato
var express = require('express');
var app = express();
require('http').createServer(app).listen(3000
, function(err){
console.log(err || "Listening on 3000");
});
@gregtap
gregtap / bounding_box_fabricjs.js
Last active September 26, 2016 16:05
Get bounding box off all objects on a fabric canvas
getBoardBoundingBox: function(canvas) {
var minX = Number.MAX_VALUE;
var maxX = Number.MIN_VALUE;
var minY = Number.MAX_VALUE;
var maxY = Number.MIN_VALUE;
canvas.forEachObject(function(o){
var rad = o.angle * Math.PI/180;
var w = o.width * o.scaleX;