Skip to content

Instantly share code, notes, and snippets.

View alv-alvarez's full-sized avatar

Alvaro Alvarez alv-alvarez

  • Santiago, Chile
View GitHub Profile
@paulund
paulund / add-option-to-dropdown.js
Created June 25, 2013 18:50
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@pzin
pzin / devise.es.yml
Created June 26, 2013 01:46
Traducción al español/castellano (tú) para usar con Devise.
es:
devise:
confirmations:
confirmed: "Tu cuenta ya ha sido confirmada. Has sido indentificado."
send_instructions: "Recibirás un correo electrónico en unos minutos con instrucciones sobre cómo reestablecer tu contraseña."
send_paranoid_instructions: "Si tu correo electrónico existe en nuestra base de datos, recibirás un correo electrónico en unos minutos con instrucciones sobre cómo reiniciar tu contraseña."
failure:
already_authenticated: "Ya estás identificado."
inactive: "Tu cuenta aún no ha sido activada."
invalid: "Correo o contraseña inválidos."
@leon
leon / .bowerrc
Created September 5, 2013 07:11
Advanced Grunt Setup
{
"directory": "bower_components",
"json": "bower.json"
}
@speric
speric / poodir-notes.md
Last active March 25, 2025 01:06
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 8, 2025 15:03
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@ig10
ig10 / kompass2015.js
Last active August 29, 2015 14:16
Auto Fill Kompass 2015 Apply Forms
javascript:((function registerKompass() {
var step1 = {
radio: ["rdoServiceIn_0"],
common: {
"txtLastName": 'PASSPORT LAST NAME',
"txtFirstName": 'PASSPORT FIRST NAME',
"txtDob": 'yyyy-mm-dd',
"ddlCitizenship": 'COUNTRY', // CL == Chile
"txtEmailAddress": '[email protected]',
"txtEmailAddressConfirm": '[email protected]',
@wvengen
wvengen / README.md
Last active January 5, 2025 05:20
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@leny
leny / .eslintrc.json
Last active August 3, 2024 16:44
ESLint config file for node.js + ES6 projects.
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 10, 2025 14:56
Vanilla JavaScript Quick Reference / Cheatsheet

React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app