Skip to content

Instantly share code, notes, and snippets.

View hosamshahin's full-sized avatar

Hossameldin Shahin hosamshahin

  • Thomson Reuters
  • Waterloo, ON, Canada
View GitHub Profile
@hosamshahin
hosamshahin / 0_reuse_code.js
Created October 4, 2016 14:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hosamshahin
hosamshahin / github.sh
Last active September 12, 2020 20:15 — forked from tbranyen/github.sh
#!/bin/bash
#
# Copyright 2011, Tim Branyen @tbranyen <[email protected]>
# Dual licensed under the MIT and GPL licenses.
#
# Automatically clone single or multiple repos into a folder,
# great for setting up a git projects folder.
#
# Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/bin/gh
# chmod +x /usr/local/bin/gh
@hosamshahin
hosamshahin / bash-cheatsheet.sh
Last active September 5, 2017 20:35 — forked from LeCoupa/bash-cheatsheet.sh
Shell: Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
# Rails Migration
http://guides.rubyonrails.org/migrations.html
## Migrations methods:
* add_column
* add_index
* change_column
* change_table
* create_table
* drop_table
@hosamshahin
hosamshahin / Rails: Models cheat sheet
Created May 21, 2016 16:30 — forked from krishna-shilpakar/index.md
Rails models cheatsheet
# Rails Models
### Generating models
$ rails g model User
### Associations
belongs_to
has_one
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) In your rails applicaiton root folder create self signed certificate
$ openssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -subj "/C=US/ST=Colorado/L=Colorado Springs/O=SW/CN=localhost.ssl" -keyout server.key -out server.crt
# 2) Add localhost.ssl to your hosts file
$ echo "127.0.0.1 localhost.ssl" | sudo tee -a /etc/hosts