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
connection method: Standard TCP/IP over SSH
SSH Hostname: 192.168.33.10
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: ~/.vagrant.d/insecure_oreivate_key
MySQL Hostname: 127.0.0.1
MySQL Server Port: 3306
Username: root
Password: password
immigrant: This generates a migration that builds all missing foreign key constraints.
(https://github.com/jenseng/immigrant)
- login to MySQL using root user
mysql -u root -p root
create database opendsa_lti;
grant all privileges on opendsa_lti.* to 'opendsa'@'localhost' identified by 'opendsa';
FLUSH PRIVILEGES;
exit
- Configuring User Model
http://code.tutsplus.com/tutorials/create-beautiful-administration-interfaces-with-active-admin--net-21729
- this stackoverflow discussion solve it
http://stackoverflow.com/questions/8360787/rails-3-can-active-admin-use-an-existing-user-model
- better follow the documentation!
http://activeadmin.info/docs/0-installation.html
public int factorial(int n)
{
int result = 1;
for (int i = 1; i <= n; i++) {
result = result * i;
}
return result;
}
- LTI App
name: CodeWorkout
key: test
secret: secret
launch url: https://192.168.33.20:9292/lti/launch
domain: https://192.168.33.20:9292
privacy: public
- create module
- create item (external tool)
@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
- Progress bar
https://infinum.co/the-capsized-eight/articles/progress-bar-in-rails
- background jobs
https://www.agileplannerapp.com/blog/building-agile-planner/rails-background-jobs-in-threads
- changes required to you app before deployment
http://railsapps.github.io/rails-heroku-tutorial.html
# SSH authentication via keys
- Open a terminal on your local machine A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):