Skip to content

Instantly share code, notes, and snippets.

View joshgo's full-sized avatar
🏠
Working from home

Josh joshgo

🏠
Working from home
View GitHub Profile
@joshgo
joshgo / git-author-cleanup-notes.txt
Last active November 26, 2017 05:41
Cleanup git email/authors
https://help.github.com/articles/changing-author-info/
# Show the email/name of the authors in a unique list
git log | grep Author | uniq
# change email script
git filter-branch --env-filter '
OLD_EMAIL="*****"
OLD_EMAIL2="*****"
OLD_EMAIL3="*****"
@joshgo
joshgo / keybase.md
Created May 16, 2017 13:28
keybase verification

Keybase proof

I hereby claim:

  • I am joshgo on github.
  • I am joshgo (https://keybase.io/joshgo) on keybase.
  • I have a public key whose fingerprint is F0AE 27E0 1F7C 4221 590F 151E CDF3 6C25 8053 C2B6

To claim this, I am signing this object:

@joshgo
joshgo / keybase.md
Created May 16, 2017 13:28
keybase verification

Keybase proof

I hereby claim:

  • I am joshgo on github.
  • I am joshgo (https://keybase.io/joshgo) on keybase.
  • I have a public key whose fingerprint is F0AE 27E0 1F7C 4221 590F 151E CDF3 6C25 8053 C2B6

To claim this, I am signing this object:

@joshgo
joshgo / js-pascal-triangle.js
Created May 11, 2017 02:18
JS Pascal Triangle - Tweaked @jtabachnick's code to only use one array
/**
* Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
*/
var Pascals = {
@joshgo
joshgo / pushstate-example.js
Created April 12, 2017 15:15
javascript pushstate example
var newQS = "?foo=1";
if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + newQS;
window.history.pushState({ path: newurl }, '', newurl);
}
class Solution {
public:
int lengthOfLongestSubstring(string s) {
int lookup[127] = {-1};
int longest = 0;
int length = 0;
int start = 0;
memset(lookup, -1, sizeof(lookup));
@joshgo
joshgo / longest_increasing_subsequence_v2.cpp
Created June 13, 2016 04:00
A faster version of my original longest_increasing_subsequence solution. Could be faster still.
int longest_increasing_subsequence_v2(vector<int>& nums)
{
map<int, set<int>> table;
int tmax = 0;
for(int i = 0; i < nums.size(); i++)
{
int pmax = 1;
for(map<int, set<int>>::reverse_iterator itr = table.rbegin(); itr != table.rend(); itr++)
@joshgo
joshgo / longest-increasing-subsequence.cpp
Created June 13, 2016 03:40
Find longest increasing subsequence:
int longest_increasing_subsequence(vector<int>& nums)
{
map<int, int> table;
int tmax = 0;
for(int i = 0; i < nums.size(); i++)
{
int pmax = 0;
for(map<int, int>::iterator itr = table.begin(); itr != table.end() && itr->first < nums[i]; itr++)
@joshgo
joshgo / longest-increasing-subsequence.cpp
Last active June 13, 2016 03:57
Find longest increasing subsequence
int longest_increasing_subsequence(vector<int>& nums)
{
map<int, int> table;
int tmax = 0;
for(int i = 0; i < nums.size(); i++)
{
int pmax = 0;
for(map<int, int>::iterator itr = table.begin(); itr != table.end() && itr->first < nums[i]; itr++)
choco install googlechrome
choco install git
choco install TortoiseGit
choco install 7zip
choco install sysinternals
choco install HeidiSQL
choco install winscp
choco install putty
choco install sublimetext3
choco install notepadplusplus