Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Creating epic shit!

Romel Pérez romelperez

:electron:
Creating epic shit!
View GitHub Profile
@romelperez
romelperez / array.methods.js
Created Feb 1, 2015
JavaScript Array Methods
View array.methods.js
// 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 Nov 22, 2016
A jQuery plugin boilerplate
View jquery.plugin.js
const NAME = 'pluginName';
const methods = {
method1: function () {
const conf = this.data(`${NAME}-config`);
if (!conf) return this;
@romelperez
romelperez / linux-shortcuts.sh
Last active Dec 28, 2017
Linux shortcuts commands
View linux-shortcuts.sh
# 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 Aug 4, 2016
A throttle function for JavaScript.
View throttle.js
/**
* 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}
View atom.snippets.cson
# 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 Nov 21, 2016
vulcan-estudios-training.md
View 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.
View atom.styles.less
/*
* 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 Feb 5, 2017
Atom keybinding map
View atom.keymap.cson
# 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 Jun 25, 2017 — forked from demonio/kuwy.css
KuWy from KumbiaPHP developers
View demos.html
<!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; }
View backups.sh
# 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