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
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 / 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);
}
@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 / 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 / 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="*****"