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 / learn.js
Last active October 26, 2018 19:45
#javascript #cheatsheet
// Single-line comments start with two slashes.
/* Multiline comments start with slash-star,
and end with star-slash */
// Statements can be terminated by ;
doStuff();
// ... but they don't have to be, as semicolons are automatically inserted
// wherever there's a newline, except in certain cases.
@awkale
awkale / learn.rb
Last active December 13, 2022 11:57
#ruby #cheatsheet
# This is a comment
=begin
This is a multiline comment
No-one uses them
You shouldn't either
=end
# First and foremost: Everything is an object.
@awkale
awkale / learn.yaml
Created March 15, 2016 18:56
yaml cheatsheet
# Les commentaires sont précédés d'un signe "#", comme cette ligne.
#############
# SCALAIRES #
#############
# Les scalaires sont l'ensemble des types YAML qui ne sont pas des collections
# (listes ou tableaux associatifs).
@awkale
awkale / find-kill.sh
Last active September 8, 2017 14:00
find and kill #process using a certain port #tool
lsof -i :3000
kill -9 {PID #}
@awkale
awkale / heroku_console
Created February 5, 2016 19:01
use rails console on heroku
heroku run console
@awkale
awkale / core.editor
Created February 1, 2016 16:48
git config editor
git config --global core.editor "atom --wait"
git config --global core.editor "subl -n -w"
@awkale
awkale / gist:40c09562b918b83cf289
Last active October 26, 2018 19:44 — forked from datwright/gist:1082717
#rails #migrations Cheat sheet
# Migration generator shortcuts.
# rails generate migration MyNewMigration
# rails generate migration add_fieldname_to_tablename fieldname:string
# rails generate model Product name:string description:text
# The set of available column types [:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean]
# A migration is a subclass of ActiveRecord::Migration. You must implement the "up" and "down" (revert) methods.
# These are the handy methods available to a Migration:
@awkale
awkale / personObject.js
Last active December 14, 2015 15:14
reusable object in javascript; uses a function
(function() { // protect namespace, Immediately-Invoked Function Expression (IIFE)
function Person( firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
Person.prototype.greet = function() { // prototypes allows object to inherit function properties
return "hello my name is " + this.firstName;
}
@awkale
awkale / rails-cheat-sheet.md
Last active October 25, 2018 21:08
#rails #cheatsheet
  1. Open terminal and check versions of Ruby and Rails against production server params or to make sure you are using the most recent stable versions.
  $ ruby -v
  $ rvm list
  $ rvm list known
  $ rvm install ruby 2.2.1
  $ rvm list
  $ ruby -v
  $ gem install rails
 $ rails -v
@awkale
awkale / postgres.md
Last active August 18, 2024 08:08
#cheatsheet #postgres

start

pg_ctl -D /usr/local/var/postgres start

stop

pg_ctl -D /usr/local/var/postgres stop

Start automatically

brew services start postgresql

check if postgress is running