Skip to content

Instantly share code, notes, and snippets.

View katmutua's full-sized avatar
:shipit:

Jackie katmutua

:shipit:
  • Oracle
  • Canada
  • 12:50 (UTC -04:00)
View GitHub Profile
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
#!/usr/bin/env
import pandas as pd
import numpy as np
# Define the diff function to show the changes in each field
def report_diff(x):
return x[0] if x[0] == x[1] else '{} ---> {}'.format(*x)
# We want to be able to easily tell which rows have changes
def has_change(row):
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
@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();
*/
@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
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
$ 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
@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'
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 / 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