Referencia rápida de Javascript
(basado principalmente en la especificación de ECMAScript 6)
// 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] |
(basado principalmente en la especificación de ECMAScript 6)
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'"
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
"Comentarios van entre comillas dobles,
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 |
(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
# 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 |
if ENV['RM_INFO'] | |
gem 'debase' | |
gem 'ruby-debug-ide' | |
end |
class Fixnum | |
def prime? | |
self > 1 && (2..self-1).all? { |i| self % i != 0 } | |
end | |
def divisible_by?(a_divisor) | |
self % a_divisor == 0 | |
end |
[Desktop Entry] | |
Version=1.0 | |
Terminal=false | |
Type=Application | |
Name=Gtasks | |
Exec=/usr/bin/chromium --app=https://mail.google.com/tasks/canvas?pli=1 | |
Icon=chrome |