Skip to content

Instantly share code, notes, and snippets.

View romelperez's full-sized avatar
:electron:
Creating epic shit!

Romel Perez romelperez

:electron:
Creating epic shit!
View GitHub Profile
@romelperez
romelperez / array.methods.js
Created February 1, 2015 22:24
JavaScript Array Methods
// ARRAY METHODS //
// array.concat(item...)
var a = ['a', 'b', 'c'];
var b = ['x', 'y', 'z'];
var c = a.concat(b, true);
// c is ['a', 'b', 'c', 'x', 'y', 'z', true]
// array.join(separator)
var a = ['a', 'b', 'c'];
@romelperez
romelperez / jquery.plugin.js
Last active November 22, 2016 17:17
A jQuery plugin boilerplate
const NAME = 'pluginName';
const methods = {
method1: function () {
const conf = this.data(`${NAME}-config`);
if (!conf) return this;
@romelperez
romelperez / linux-shortcuts.sh
Last active December 28, 2017 21:56
Linux shortcuts commands
# Line count
find ./ -name '*.js' | xargs wc -l
# Convert webp files whithin directory to png
find ./ -name "*.webp" -exec dwebp {} -o {}.png \;
# Generate random string
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
@romelperez
romelperez / throttle.js
Last active August 4, 2016 04:27
A throttle function for JavaScript.
/**
* Returns a function that will be called once in an interval of time right
* away when it is called.
*
* @param {Function} func - The function to throttle.
* @param {Number} interval - Time in milliseconds.
* @param {Function} gate - The function to validate the throttle. If it return
* true, we prevent the throttle.
*
* @return {Function}
# JAVASCRIPT
'.source.js, .source.ts, .source.tsx':
'Require':
'prefix': 'req'
'body': 'const ${1:module} = require(\'${1:module}\');'
'Module Exports':
'prefix': 'export'
'body': 'module.exports = $1;'
'Import':
'prefix': 'import'
@romelperez
romelperez / vulcan-estudios-training.md
Last active November 21, 2016 22:56
vulcan-estudios-training.md

Capacitación

Metodologías

  • Cómo elegir la metodología correcta para cada equipo de desarrollo? Cuál es tu experiencia con metologías ágiles?
  • Cuál es tu herramienta favorita para llevar el tracking del proceso de desarrollo y la comunicación con los clientes?

General

  • Sobre testing: Cómo decidir qué testear? Teniendo en cuenta: tamaño, complejidad e inversión.
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@romelperez
romelperez / atom.keymap.cson
Last active February 5, 2017 00:16
Atom keybinding map
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@romelperez
romelperez / demos.html
Last active June 25, 2017 00:05 — forked from demonio/kuwy.css
KuWy from KumbiaPHP developers
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Kuwy</title>
<link rel="stylesheet" href="./kuwy.css">
<style>
body { margin: 20px; font-family: sans-serif; }
# backup
mongodump --db=mydb --archive=./backups/mydb.mongodump --authenticationDatabase=mydb -u username -p
# restore
mongorestore --drop --archive=./backups/mydb.mongodump --authenticationDatabase=mydb -u username -p
# export
mongoexport --db mydb --collection users --out ./test/fixtures/users.json --pretty --jsonArray
# import