sudo adduser ubuntu
sudo su ubuntu
cd /home/ubuntu
mkdir .ssh
chmod 700 .ssh
cd .ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# . set_gopath.sh | |
export GOPATH=`pwd` | |
export PATH="$GOPATH/bin:$PATH" | |
# for mac osx | |
# export GOBIN=$GOPATH/bin | |
# unset if `flogo build` | |
git config --global --unset alias.gb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
class Solution(object): | |
def alienOrder(self, words): | |
""" | |
:type words: List[str] | |
:rtype: str | |
""" | |
graph = defaultdict(list) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | difficulty | title | |
---|---|---|---|
253 | Medium | Meeting Rooms II | |
269 | Hard | Alien Dictionary | |
681 | Medium | Next Closest Time | |
159 | Hard | Longest Substring with At Most Two Distinct Characters | |
642 | Hard | Design Search Autocomplete System | |
158 | Hard | Read N Characters Given Read4 II - Call multiple times | |
683 | Hard | K Empty Slots | |
716 | Easy | Max Stack | |
755 | Medium | Pour Water |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AlternateMouseScroll</key> | |
<true/> | |
<key>AppleAntiAliasingThreshold</key> | |
<integer>1</integer> | |
<key>AppleScrollAnimationEnabled</key> | |
<integer>0</integer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
class Scratch { | |
class Shark { | |
private final String name = "Sharkie"; | |
public String getName() { return name; } | |
}// A | |
class HammerShark extends Shark{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// need to use launchWebAuthFlow in chrome extension | |
// can't use gapi in extension | |
// https://github.com/google/google-api-javascript-client/issues/64 | |
async function getIdTokenInfo(id_token: string) { | |
const resp = await fetch( | |
`https://oauth2.googleapis.com/tokeninfo?id_token=${id_token}` | |
); | |
return resp.json(); | |
} |