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
App 2091 output: Error during failsafe response: undefined local variable or method `env' for #<ExceptionHandler::ExceptionController:0x000055a292149300>
App 2091 output: Did you mean? end
App 2091 output: END
App 2091 output: /home/ubuntu/OpenDSA-LTI/app/controllers/exception_handler/exception_controller.rb:30:in `status'
App 2091 output: /home/ubuntu/OpenDSA-LTI/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:428:in `block in make_lambda'
App 2091 output: /home/ubuntu/OpenDSA-LTI/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
App 2091 output: /home/ubuntu/OpenDSA-LTI/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.1/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
App 2091 output: /home/ubuntu/OpenDSA-LTI/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:201:in `block in halting'
App 2091 output: /home/ub
sudo su - postgres
createdb database_name
psql -s database_name
create user database_name password 'database_name';
GRANT ALL PRIVILEGES ON DATABASE database_name TO database_name;
dropdb database_name
# stop postgress process and release port 5432 on Mac
brew services stop postgresql
{
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 1,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": false,
"fallback_encoding": "UTF-8",
"font_size": 12,
"highlight_modified_tabs": true,
# remove the virtualbox
sudo apt-get autoremove 'virtualbox*'
# download and install 5.1
http://download.virtualbox.org/virtualbox/5.1.14/virtualbox-5.1_5.1.14-112924~Ubuntu~xenial_amd64.deb
# download and install VirtualBox 5.1.14 Oracle VM VirtualBox Extension Pack
http://download.virtualbox.org/virtualbox/5.1.14/Oracle_VM_VirtualBox_Extension_Pack-5.1.14-112924.vbox-extpack
# -*- coding: utf-8 -*-
from time import sleep
import sys
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console
https://gist.github.com/aubricus/f91fb55dc6ba5557fbab06119420dd6a
Call in a loop to create terminal progress bar
@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 <tim@tabdeveloper.com>
# 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
-- http://blog.rtwilson.com/how-to-get-sublime-text-style-editing-in-the-ipythonjupyter-notebook/
Anaconda 3.5
custom.js file path
/home/hshahin/anaconda3/lib/python3.5/site-packages/notebook/static/custom/custom.js
So, how do you do this? It’s really simple.
Find your Jupyter configuration folder by running jupyter --config-dir
-- Reinstall
First remove MySQL:
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
Then reinstall:
sudo apt-get update
sudo apt-get install mysql-server
@hosamshahin
hosamshahin / listADT
Last active September 9, 2016 23:30
code-workout: list ADT
public List buildList(List L)
{
L.moveToStart();
L.insert(30);
L.insert(23);
L.insert(19);
L.insert(4);
L.moveToPos(2);
return L;