Skip to content

Instantly share code, notes, and snippets.

View krosti's full-sized avatar
🚲
Exploring

Fernando Cea krosti

🚲
Exploring
View GitHub Profile
@krosti
krosti / app.js
Created September 2, 2015 14:17
ExpressJS Cluster test
var cluster = require('cluster');
if(cluster.isMaster) {
var numWorkers = require('os').cpus().length;
console.log('Master cluster setting up ' + numWorkers + ' workers...');
for(var i = 0; i < numWorkers; i++) {
cluster.fork();
}
@krosti
krosti / Gulpfile.js
Last active August 31, 2015 19:26 — forked from Hendrixer/Gulpfile.js
Gulpfile with Livereload, Nodemon, and other features
var gulp = require('gulp'),
exec = require('child_process').exec,
sass = require('gulp-ruby-sass'),
concat = require('gulp-concat'),
plumber = require('gulp-plumber'),
server = require('tiny-lr')(),
refresh = require('gulp-livereload'),
mocha = require('gulp-mocha'),
notify = require('gulp-notify'),
nodemon = require('gulp-nodemon'),
@krosti
krosti / log.log
Created May 13, 2015 15:17
Protractor-perf - Error on Connect
Error: [execute("(function(){var getTimeMs=(function(){if(window.performance)\nreturn(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow).bind(window.performance);else\nreturn function(){return new Date().getTime();};})();var requestAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})().bind(window);window.__RafRecorder={frames:[],flush:true,record:function(timeStamp){if(__RafRecorder.flush){__RafRecorder.frames=[];__RafRecorder.flush=false;}\n__RafRecorder.frames.push(timeStamp);requestAnimationFrame(__RafRecorder.record);},get:function(){__RafRecorder.flush=true;return __RafRecorder.frames;}};requestAnimationFrame(window.__RafRecorder.record);}());")] connect ECONNREFUSED
Stacktrace:
Error: connect ECONNREFUSED
at errnoException (net.js:905:11)
at Ob
@krosti
krosti / oneway-directive.js
Created April 15, 2015 19:43
Angular-oneway directive
'use strict';
var toBoolean = function(value) {
if (value && value.length !== 0) {
var v = angular.lowercase("" + value);
value = !(v === 'f' || v === '0' || v === 'false' || v === 'no' || v === 'n' || v === '[]');
} else {
value = false;
}
return value;
@krosti
krosti / git-shortcuts.md
Last active August 29, 2015 14:06
Git shortcuts

git

aliases:

  • git config --global alias.st status
  • git config --global alias.ci commit
  • git config --global alias.co checkout
  • git config --global alias.br branch

info:

  • git config --global user.name ”Your Name Comes Here”
@krosti
krosti / Preferences.sublime-settings
Created August 21, 2014 14:41
Sublime Text 3 - Preferences
{
"bold_folder_labels": true,
"color_inactive_tabs": true,
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"colored_folder_glyphs": true,
"font_options": "subpixel_antialias",
"font_size": 11,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@krosti
krosti / file.js
Created March 14, 2013 17:45
jquery UI - autocomplete - accent folding example
$(function() {
var names = [ "Jörn Zaefferer", "Scott González", "John Resig" ];
var accentMap = {
"á": "a",
"ö": "o"
};
var normalize = function( term ) {
var ret = "";
for ( var i = 0; i < term.length; i++ ) {
@krosti
krosti / index.html
Created February 13, 2013 15:28
Andres en guatrache :)
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1" height="230" width="300">
<label t="translate(0,225)">
@krosti
krosti / index.html
Last active December 13, 2015 16:59 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">BorealDev office</tspan>
</label>
<actor t="translate(151,59) rotate(3)" pose="-11,9|21,109|-11,99|-11,89|-13,75|-13,55|2,42|-3,17|11,49|16,24|-18,79|6,69|-6,79|20,71">
@krosti
krosti / formatMoney.js
Created November 6, 2012 17:26
formayMoney prototype function in javascript
/* global prototype formatMoney function
* params:
* c (integer): count numbers of digits after sign
* d (string): decimals sign separator
* t (string): miles sign separator
*
* example:
* (123456789.12345).formatMoney(2, ',', '.');
* => "123.456.789,12" Latinoamerican moneyFormat
*/