Skip to content

Instantly share code, notes, and snippets.

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

Flavio Corpa kutyel

🌊
数学者に俺は成る!
View GitHub Profile
@kutyel
kutyel / keybindings.json
Created April 20, 2016 13:12
VSCode Personal Keybindings
[
{ "key": "ctrl+l", "command": "workbench.action.editor.changeLanguageMode" },
{ "key": "ctrl+numpad_divide", "command": "editor.action.commentLine", "when": "editorTextFocus" }
]
@kutyel
kutyel / employee.sh
Created April 22, 2016 12:08
From Oracle to Google
$ sqlplus -s
SQL> connect [email protected]/hr
SQL> UPDATE employees SET current = false WHERE email = "[email protected]";
SQL> COMMIT;
SQL> disconnect
SQL> exit
$ curl -X POST -H "Content-Type: application/json" \
-d '{ "firstName":"Igor", "lastName":"Minar"}' \
http://google.com/employee/
@kutyel
kutyel / ranking.sh
Created May 10, 2016 08:15
Show ranking of a repo by number of commits
git shortlog -sn --no-merges
@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 / settings.json
Created June 8, 2016 06:20
Ignore JavaScript generated files when working with TypeScript in VSCode
{
"files.exclude": {
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.js.map": true
}
}
@kutyel
kutyel / skype-interview.js
Last active November 15, 2018 13:47
Skype Technical Interview's Questions about JavaScript
/**
* Write a JavaScript function that takes a number n and returns the sum of the even numbers from 1 to n.
*/
function firstFunc(n) {
let result = 0;
for (let index = 1; index <= n; index++) {
if (index % 2 === 0) {
result += index;
}
}
/**
* Configuración de SystemJS para Angular 2
*/
(function(global) {
// el map le dice a System dónde buscar las cosas que ha de cargar
var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs'
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#6.0.0+20160613154055"
}
}
@kutyel
kutyel / monkey-patch.js
Created June 28, 2016 08:07 — forked from naholyr/monkey-patch.js
JS monkey patching
// Original method
var object = {
method: function (x, y) {
return x+y;
}
}
// Add operations before or after!
object.method = (function (original) {
return function (x, y) {
@kutyel
kutyel / post-commit.sh
Last active August 4, 2016 12:18
Post commit hook!
#!/bin/sh
#
# by Flavio Corpa
# get last two commits date from git log (in seconds)
arr=($(git log -2 --author="[email protected]" --format=%at))
# convert them to hours (with decimals)
hours=$(awk "BEGIN {printf \"%.2f\",$(((arr[0]-arr[1])/3600))}")