Skip to content

Instantly share code, notes, and snippets.

View joseluisq's full-sized avatar

Jose Quintana joseluisq

View GitHub Profile
@joseluisq
joseluisq / ruby_sass_vs_libsass.md
Last active August 29, 2015 14:07
A Little Grunt Speed Comparatives between Libsass (C++) and Ruby Sass
Some Sass files compiled :

>> File "app/css/screen-small.css" changed.
>> File "app/css/screen-high-resolutions.css" changed.
>> File "app/css/screen-medium.css" changed.
>> File "app/css/screen-large.css" changed.
>> File "app/css/screen-default.css" changed.
>> File "app/css/helpers.css" changed.
@joseluisq
joseluisq / IE-match-comments.md
Last active August 29, 2015 14:07
Simply solution for IE comments matching to using Javascript RegExp.
@joseluisq
joseluisq / doctrine-entities-generator.sh
Created October 20, 2014 15:00
Linux shell script to generate entities for PHP Doctrine 2
#!/bin/sh
# Doctrine 2 Entities Generator v0.1
# ==================================
# Requirements
# ============
# It's necessary to create a composer project before exec this script.
# More info about composer at https://getcomposer.org/doc/00-intro.md
@joseluisq
joseluisq / groupingObjects.js
Created October 20, 2014 23:17
Javascript grouping array of object by key
function groupingObjects(groupBy, groupKey, list) {
var g = {}, e, i;
for (i = 0; i < list.length; ++i) {
e = list[i];
if (g[e[groupBy]] === undefined) {
g[e[groupBy]] = {};
g[e[groupBy]][group] = [];
}
@joseluisq
joseluisq / Preferences.sublime-settings
Last active August 29, 2015 14:08
Sublime Text 3 Predawn dark interface user settings
{
"color_scheme": "Packages/User/predawn (SL).tmTheme",
"theme": "predawn-DEV.sublime-theme",
// Typography
"font_face": "Office Code Pro",
"font_size": 10,
"font_options": ["no_round"],
"tab_size": 2,
"highlight_line": true,
"caret_style": "phase",
@joseluisq
joseluisq / nodejs_useful_commands.md
Created October 30, 2014 18:08
NodeJS useful commands

Set Python version for node-gyp

$ npm config set python python2.7
@joseluisq
joseluisq / regex_functions.md
Created November 6, 2014 16:01
Javascript RegEx Useful Functions

Add comma for thousands numbers

function numberWithCommas(x) {
  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}

Checks if a valid decimal number

@joseluisq
joseluisq / main.js
Last active August 29, 2015 14:09
Basic Main.js example for single landing page app.
(function($) {
'use strict';
// App
var app = (function() {
var timing = 300,
$w,
$slider,
$menu;
@joseluisq
joseluisq / nodejs_random_alpha.js
Last active August 29, 2015 14:09
Nodejs Random Alpha Characters
var crypto = require('crypto');
// Usage:
// > randomAlpha(4, 'abcdefghijklmnopqrstuwxyz');
// > 'wsxq'
function randomAlpha(howMany, chars) {
chars = chars || 'abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789';
var rnd = crypto.randomBytes(howMany),
value = new Array(howMany),
len = chars.length;
@joseluisq
joseluisq / clickTAG.as
Last active August 29, 2015 14:10
Google ClickTAG handler in ActionScript 3.0
// Google ClickTAG: Click event handler
clicktag_btn.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent):void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTAG)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});