Skip to content

Instantly share code, notes, and snippets.

View jesusr's full-sized avatar
🎯
Focusing

Jesús R Peinado jesusr

🎯
Focusing
View GitHub Profile
@jesusr
jesusr / flatten-un.js
Created July 3, 2017 07:17
Flatten & unflatten
function unflatten(data) {
if (Object(data) !== data || Array.isArray(data)) {
return data;
}
let regex = /\%?([^%\[\]]+)|\[(\d+)\]/g,
resultholder = {};
for (let p in data) {
if (data[p]) {
let cur = resultholder,
@jesusr
jesusr / Readme.md
Created January 15, 2016 00:38
Mocha

Mocha

@jesusr
jesusr / Readme.md
Last active January 15, 2016 00:36
NVM

NodeJS Version Manager

Reasons for use NVM

  • In multiple project development environment, it could be neccessary to use different version of NodeJS in different projects.
  • It could be essential, due to support the dependencies of modules in two project with variable needs.

Reasons not to use NVM

@jesusr
jesusr / indexof.js
Last active August 29, 2015 14:25
Array indexOf prototyping for IE8
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
return -1;
<div class="jrSlider">
<div class="jrSliderWrapper">
<div class="first" data-bg="/assets/img/img_pacolobaton.jpg">
<div class="caption">
<div class="captionWrapper">
<h2>Todo y Todos por encontrarlos</h2>
<p>La diferencia entre perderlos y encontrarlos radica en actuar a tiempo y todos a una, con todos los medios.</p>
<p><a href="{{ path('pacolobaton') }}" class="btn">Conoce más</a></p>
</div>
</div>
@jesusr
jesusr / _offnavigation.sass
Last active August 29, 2015 14:13
Off Canvas navigation animated
@import "compass/utilities/general/clearfix"
$color: white
$blue: #158fef
$light-blue: #2196F3
$indigo: #283593
$animation: 0.6s
$scale: 1
header
min-height: 350px
background: lighten($light-blue,20%)
@jesusr
jesusr / _aside-icon.sass
Created January 19, 2015 16:39
Aside icon mixin
=aside-icon($image:none,$width:50px,$height:$width,$pos:left)
margin: 2em
padding-#{$pos}: $width + 10px
line-height: $height
background: url($image) no-repeat $pos 0
background-size: $width
h2
display: inline-block
+aside-icon('http://www.michellefit.ca/wp-content/uploads/2013/11/male-4-icon.png')
@jesusr
jesusr / _tags.html
Last active June 18, 2021 22:31
Pure CSS Tags
<div class="tags">
<a href="">Tag 1</a>
<a href="">Tag 2</a>
<a href="">Tagagagagagagagagag 3</a>
</div>
@jesusr
jesusr / Gruntfile.js
Created January 13, 2015 10:44
Gruntfile.js Example
module.exports = function(grunt){
grunt.initConfig({
shell: {
'options': {
'stdout': true,
'stderr': true,
'failOnError': true
},
drushall: {
command: 'drush cc all',
@jesusr
jesusr / core.js
Created January 6, 2015 18:32
Angular.js module declaration with exception alert catched
/**
* Module
*/
var module;
try {
module = angular.module(moduleName);
} catch(err) {
// named module does not exist, so create one
module = angular.module(moduleName, []);
}