Skip to content

Instantly share code, notes, and snippets.

View kutyel's full-sized avatar
🌊
数学者に俺は成る!

Flavio Corpa kutyel

🌊
数学者に俺は成る!
View GitHub Profile
@kutyel
kutyel / functional-programming-polyfill.js
Last active June 7, 2016 12:29 — forked from keropodium/array.js
Immutable-Functional-Array 🐑💨
Array.prototype.push = function(x) {
return [].concat(this, x);
};
Array.prototype.pop = function() {
return this.slice(0, this.length-1);
};
Array.prototype.unshift = function(x) {
return [].concat(x, this);
@kutyel
kutyel / async_await.js
Last active August 8, 2017 10:58 — forked from Jviejo/asyncawait.ts
async / await, finally in ES2017
// las funciones con await deben de tener el prefijo async
async function main () {
try {
const result = await pedirPermisos();
// dependemos del servicio anterior para realizar el siguiente
if (result) {
const geolocation = await llamarAPIGoogleMaps();
console.log(geolocation);
@kutyel
kutyel / ngEnter.js
Last active August 29, 2015 14:26 — forked from EpokK/ngEnter.js
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
});