Skip to content

Instantly share code, notes, and snippets.

View ngarbezza's full-sized avatar
🆖
TDD all the things!

Nahuel Garbezza ngarbezza

🆖
TDD all the things!
View GitHub Profile
@ngarbezza
ngarbezza / smalltalk-referencia-rapida.md
Last active February 2, 2023 21:52
Referencia rápida de Smalltalk

Ejemplos de sintaxis Smalltalk

nota: para ver los resultados de cada fragmento de código, selecccionarlo y usar la opción print-it (ctrl+p) para ver el resultado en el mismo editor de código, o la opción inspect-it (ctrl+i) para abrir un inspector sobre el resultado

Elementos generales del lenguaje

"Comentarios van entre comillas dobles,
@ngarbezza
ngarbezza / remove_unnecessary_conditional.js
Last active November 2, 2021 23:51
A simple refactoring for JS made with Acorn (https://github.com/acornjs/acorn)
// this is our input
sourceCode = 'if (a > b) { return true } else { return false }'
// now we call the parser with the right set of options
const acorn = require('acorn')
programNode = acorn.parse(sourceCode, { ecmaVersion: 11, allowReturnOutsideFunction: true })
// validate the transformation can be made to this source code
containsOneStatement = programNode.body.length === 1
ifStatement = programNode.body[0]
@ngarbezza
ngarbezza / referencia-rapida-javascript.md
Last active August 4, 2021 14:48
Referencia rápida de Javascript

Referencia rápida de Javascript

(basado principalmente en la especificación de ECMAScript 6)

Elementos del lenguaje

Tipos de datos

Números

@ngarbezza
ngarbezza / mapa_conceptual_del_code_review.md
Last active January 5, 2021 12:10
Mapa conceptual del code review

Mapa conceptual del Code Review

(también conocido como "Claves para un code review exitoso" presentado en Ágiles 2017)

por Nahuel Garbezza (nahuel@10pines.com) Twitter/Github: @ngarbezza

Última revisión: Jun 2020

Aspectos Humanos

@ngarbezza
ngarbezza / cuis-university-assert.md
Created September 13, 2020 01:44
CuisUniversity - uso de Assert

Aserciones en CuisUniversity

Verificar si un valor es true/false

Assert isTrue: valor.                         "cuando falla, genera un error 'assertion failed'" 
Assert isTrue: valor description: 'mensaje'.  "cuando falla, genera un error con 'mensaje'"
Assert isFalse: valor.                        "cuando falla, genera un error 'assertion failed'"
Assert isFalse: valor description: 'mensaje'. "cuando falla, genera un error con 'mensaje'"
@ngarbezza
ngarbezza / referencia_rapida_javascript.js
Last active October 2, 2019 21:33
Referencia Rápida Javascript
var x = 3; // antigua declaracion de variables, pueden ser reasignadas
let y = 4; // actual declaracion de variables que pueden ser reasignadas
const z = 5; // actual declaracion de variables que NO pueden ser reasignadas
const string = `x es ${x}, y es ${y}, z es ${z}`; // los strings se pueden interpolar
// acceder al "parent" de un objeto
var lista = ['unas', 'cuantas', 'cosas'];
lista.__proto__; // prototipo de Array
lista.__proto__.__proto__; // prototipo de Object
@ngarbezza
ngarbezza / newrelic.yml
Created July 3, 2016 15:50
arq2 app newrelic
# This file configures the New Relic Agent. New Relic monitors
# Java applications with deep visibility and low overhead. For more details and additional
# configuration options visit https://docs.newrelic.com/docs/java/java-agent-configuration.
#
# This section is for settings common to all environments.
# Do not add anything above this next line.
common: &default_settings
# ============================== LICENSE KEY ===============================
# You must specify the license key associated with your New Relic
/*
Vumetro para Matriz 8x8 de LEDs RGB.
Codigo basado en:
* Visualizacion de la matriz: http://www.instructables.com/id/64-pixel-RGB-LED-Display-Another-Arduino-Clone/
* Manejo de la entrada de audio: http://neuroelec.com/2011/03/fft-library-for-arduino/
*/
#include <stdint.h>
#include <ffft.h>
@ngarbezza
ngarbezza / close-window.st
Last active December 17, 2015 10:09
Pharo
"Close a window by title programatically - Pharo 1.4, 2.0"
(SystemWindow allInstances detect: [ :w | w label = '<title>' ] ifNone: [ ^ nil ]) delete
@ngarbezza
ngarbezza / proc.rb
Created December 2, 2012 18:34
Smalltalk exception handling for Ruby 1.9.x
class Proc
def on(exception_class)
begin
self.call
rescue exception_class => e
yield e
end
end
end