Skip to content

Instantly share code, notes, and snippets.

View awkale's full-sized avatar
📈
developing

Alex Kale awkale

📈
developing
View GitHub Profile
@awkale
awkale / brew_cheatsheet
Last active October 26, 2018 19:44
#homebrew #cheatsheet
brew install git
#Install a package
brew upgrade git
#Upgrade a package
brew unlink git
#Unlink
brew link git
@awkale
awkale / gist:3a6f48b6eb2e6d6fa9cd84b13b9de45f
Created December 29, 2016 00:36 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@awkale
awkale / gzip
Created December 8, 2016 22:23
unzip and keep originals
gzip -d -k *.gz
@awkale
awkale / rails_g.rb
Last active June 13, 2023 03:19
rails generators #rails #cheatsheet
# Controller Plural
rails g controller Users index show
# Helper Plural
rails g helper Users
# Mailer Singular
rails g mailer UserMailer
# Migration Plural
@awkale
awkale / reservedKeywords.js
Created August 7, 2016 17:14
reserved keywords in javascript
break
case
catch
class
const
continue
debugger
default
delete
do
const getSecret = (secret) => {
return {
get: () => secret
};
};
test('Closure for object privacy.', assert => {
const msg = '.get() should have access to the closure.';
const expected = 1;
const obj = getSecret(1);
@awkale
awkale / console.rb
Created June 10, 2016 14:56
rails console cheatsheet
Rails.application.config.assets.paths // to see a list of load paths
@awkale
awkale / index.md
Last active October 16, 2018 18:24 — forked from rstacruz/index.md
#rails #models #cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@awkale
awkale / learnbash.sh
Created March 15, 2016 19:02
bash cheatsheet
#!/bin/bash
# La prima riga dello script è lo shebang il quale dice al sistema come eseguire
# lo script: http://it.wikipedia.org/wiki/Shabang
# Come avrai già immaginato, i commenti iniziano con #. Lo shebang stesso è un commento.
# Semplice esempio ciao mondo:
echo Ciao mondo!
# Ogni comando inizia su una nuova riga, o dopo un punto e virgola:
@awkale
awkale / learn.scss
Last active October 26, 2018 19:45
#scss #cheatsheet
//Single line comments are removed when Sass is compiled to CSS.
/* Multi line comments are preserved. */
/* Variables