Skip to content

Instantly share code, notes, and snippets.

View carlosrodriguez's full-sized avatar

Carlos Rodriguez carlosrodriguez

View GitHub Profile
@mikermcneil
mikermcneil / sails unit test example.js
Created July 8, 2013 13:59
sails unit test example
/**
* Test Instance/Class Methods on an Account Model
*/
var assert = require('assert'),
Utils = require('../../support/utils'),
Database = require('../../support/database');
describe('Account', function() {
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
BIN = ./node_modules/.bin
SRC = $(wildcard src/*.coffee)
LIB = $(SRC:src/%.coffee=lib/%.js)
build: $(LIB)
lib/%.js: src/%.coffee
@mkdir -p $(@D)
@$(BIN)/coffee -bcp $< > $@
@bag-man
bag-man / cpu.js
Last active March 29, 2024 12:01
How to calculate the current CPU load with Node.js; without using any external modules or OS specific calls.
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
@jofralogo
jofralogo / responsiveMixinsF4.sass
Last active December 15, 2015 21:18
Useful responsive SCSS mixins for Foundation 4.
/*
_______
These simple SCSS/SASS mixins for Foundation 4 are made by me to deal with media-queries and have a clean code at the same time! ;)
****IMPORTANT****
Due to Foundation 4 uses mobile-first methodology, every $phone-"X" variable in these mixins defines the value for every screen size.
$desktop-"X" values overrides $phone-"X" values when the width of the window is 768px and above.
@benpsnyder
benpsnyder / ie8-grid-foundation-4.css
Last active December 14, 2015 10:38 — forked from hatefulcrawdad/ie8-grid-foundation-4.css
a .scss version with a 24 col grid
//
// Grid Variables
//
$total-columns: 24 !default;
// Grid Calculation for Percentages
@function gridCalc($colNumber, $totalColumns) {
@return percentage(($colNumber / $totalColumns));
}
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@bernii
bernii / sauce-jasmine-example.js
Last active December 13, 2015 16:58
Example code using WD.js and Jasmine with Sauce Labs
// You need to have the following installed:
// https://github.com/admc/wd
// https://github.com/kriskowal/q
var wd = require('wd')
, Q = require('q')
, request = require('request')
, assert = require('assert')
, host = "ondemand.saucelabs.com"
, port = 80
@tlrobinson
tlrobinson / webdriver-repl.coffee
Created December 13, 2012 21:15
JavaScript REPL for multiple browsers via WebDriver.
webdriver = require 'wd'
repl = require 'repl'
Q = require 'q'
# webdriverConfig =
# host: "ondemand.saucelabs.com"
# port: 80
# username: "USERNAME"
# password: "KEY"
@tbwiii
tbwiii / Don't Close Me, Bro
Created November 14, 2012 21:07
A Bookmarklet that keeps you form accidentally closing a tab you wanted to keep open.
javascript:(function(){window.addEventListener('beforeunload',function(){return"Whoa bro, you tried to close me. \n Did you mean to do that?"})})();