Skip to content

Instantly share code, notes, and snippets.

View katmutua's full-sized avatar
:shipit:

Jackie katmutua

:shipit:
  • X
  • Canada
  • 05:02 (UTC -04:00)
View GitHub Profile
@katmutua
katmutua / gist:be7eb30ac4981038130d
Last active November 10, 2015 05:19
Create vagrant box
#ensure that an appropriate provider is installed eg virtualbox
#virtual box download: https://www.virtualbox.org/wiki/Downloads
vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
@katmutua
katmutua / gist:c36d9333cdfe9d3c6091
Last active August 29, 2015 14:27
Django Deployment Settings | uwsgi, nginx, celery
[uwsgi]
chdir={{project_home_dir}}
mountpoint={{project_home_dir}}
uid=www-data
gid=www-data
socket=127.0.0.1:8001
virtualenv={{virtual_env_dir}}
master=True
harakiri=20
pythonpath={{project_home_dir}}
@katmutua
katmutua / gist:368db9760f447a04aec2
Last active August 29, 2015 14:27
uwsg + nginx + supervisor error code debug notes
504: Timeout: Ensure that the socket used in nginx upstrem is the same set for uwsgi
502: Bad Gateway: Your app is not running, debug your supervisor run app using superviosrctl
400: Ensure that you have the ALLOWED_HOSTS= '*' or your domain set
git-sh-setup # for die
git-diff-index -p -M --cached HEAD -- | grep '^+' |
grep ddescribe && die Blocking commit because string ddescribe detected in patch
@katmutua
katmutua / db2.rb
Last active December 8, 2015 14:09
Connect to DB2 and output the results to a csv file.
require 'rubygems'
# require 'mswin32/ibm_db'
# for windows
require 'ibm_db'
# for linux
require 'date.rb'
t=Time.now
lines=[]
filename = 'c://Temp//' +t.strftime("%m%d%Y_%H%M%S")+'.txt'
$ sudo -s
$ export IBM_DB_INCLUDE=/Users/acangiano/sqllib/include
$ export IBM_DB_LIB=/Users/acangiano/sqllib/lib32
$ export ARCHFLAGS="-arch i386"
$ gem update --system
$ gem install ibm_db
$ exit
Download the zipped version of the Angular.JS Build, which contains both the builds of AngularJS, as well as documentation and other extras.
Unzip the Angular.JS docs folder.
Download and install Node.JS.
Using Mac Terminal, install the npm package http-server globally so that it can be run from the command line.
$ sudo npm install -g http-server
cd to the Angular.JS docs folder and start-up http-server.
$ http-server -a 127.0.0.1
Starting up http-server, serving ./ on: http://127.0.0.1:8080
@katmutua
katmutua / GitHistoryRewrite.txt
Created July 8, 2016 09:47
Remove folder from git history
//Eg. remove node modules from git history
git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo node_modules/ >> .gitignore
git add .gitignore
git commit -m 'Removing node_modules from git history'
git gc
git push origin master --force
@katmutua
katmutua / waitReady.js
Created August 18, 2016 09:03
Protractor Wait Function
/**
* Actively wait for an element present and displayed up to specTimeoutMs
* ignoring useless webdriver errors like StaleElementError.
*
* Usage:
* Add `require('./waitReady.js');` in your onPrepare block or file.
*
* @example
* expect($('.some-html-class').waitReady()).toBeTruthy();
*/
Quitting
:x Exit, saving changes
:q Exit as long as there have been no changes
ZZ Exit and save changes if any have been made
:q! Exit and ignore any changes
Inserting Text
i Insert before cursor