Skip to content

Instantly share code, notes, and snippets.

View jotafeldmann's full-sized avatar
🐙
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn

Jota Feldmann jotafeldmann

🐙
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
  • São Paulo, SP, Brazil
View GitHub Profile
@bruno-de-queiroz
bruno-de-queiroz / TicTacToe.markdown
Created September 3, 2014 01:15
A Pen by Bruno de Queiroz.
@renatodex
renatodex / app_model.js
Created September 12, 2016 18:12
App Model Idea
var AppModel = function() {
this.extend = function(model_setup) {
return function(model_data) {
return new factory_methods(model_setup, model_data);
}
}
this.factory_methods = function(model_setup, model_data) {
@bruno-de-queiroz
bruno-de-queiroz / core.sh
Last active January 30, 2018 13:58
Autocomplete example and annotation parser for bash scripts to make easier to expose functions and flags, to create help info and short command list for autocompletion script
#!/bin/bash
#
# Autocomplete example and annotation parser for bash scripts to make easier to expose functions and flags,
# to create help info and short command list for autocompletion script
#
# Usage:
#
# source $SCRIPT_PATH/core.sh
# ...
# #@flag -e|--environment
performance (netflix) - https://qconsp.com/system/files/keynotes-slides/qcon_sp_keynote_-_martin_spier.pdf
- metricas impressionantes deles (requests, logs, latencia, instancias etc)
- arquitetura (caches nos provedores)
- 3 regioes aws
- ec2 reserved (se nao tá streaming, usa pra recomendacoes, encoding etc)
- build: amis ubuntu
- deploy: 4000 por dia
- tudo stateless
- ferramentas (captura de metricas da redhat, flamegraph, flamescope etc)
@MarkVaughn
MarkVaughn / get_set_url_param.js
Created March 19, 2012 05:29
Get & Set URL parameter in Javascript
function getURLParameter(name) {
return decodeURIComponent(
(RegExp('[?|&]'+name + '=' + '(.+?)(&|$)').exec(location.search)||[null,null])[1]
);
}
function setURLParameter(name,value){
var search;
if(getURLParameter(name)){
search =location.search.replace(new RegExp('([?|&]'+name + '=)' + '(.+?)(&|$)'),"$1"+encodeURIComponent(value)+"$3");
}else if(location.search.length){
@19h
19h / pairingfunction.js
Last active November 12, 2018 20:08
Pairing Function for Javascript. Combines two numbers into one; used for compression of analytics data where two coordinates of mouse-clicks are combined into a single integer.
var pair = function (x, y) {
return x << 16 & 0xffff0000 | y & 0x0000ffff;
};
var depair = function (p) {
return [p >> 16 & 0xFFFF, p & 0xFFFF]
};
@dannycroft
dannycroft / exclude-node-modules
Last active February 27, 2019 18:25
Exclude node_modules out of Sublime Text 2 searches
// Add the following to your preferences file
"folder_exclude_patterns":[".git","node_modules"]
@jotafeldmann
jotafeldmann / javascript.js
Last active February 27, 2019 18:33
JavaScript: prints the current called function name and arguments from inside the function. VS Code snippet.
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
@jotafeldmann
jotafeldmann / ubuntu_installation_for_mac.md
Last active August 17, 2019 06:14
Ubuntu 18.4 installation for MacAir 2012
@ruby0x1
ruby0x1 / multi-player-html5-games-00-express.js
Created March 27, 2012 15:01
Multi-player games in HTML5
/* Copyright (c) 2012 Sven "FuzzYspo0N" Bergström
http://underscorediscovery.com
MIT Licensed. See LICENSE for full license.
Usage : node simplest.app.js
*/
var