This file contains 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
#!/bin/sh | |
set -- $(dig -t txt +short _cloud-netblocks.googleusercontent.com +trace) | |
included="" ip4="" | |
while [ $# -gt 0 ]; do | |
k="${1%%:*}" v="${1#*:}" | |
case "$k" in | |
include) | |
# only include once |
This file contains 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
#include <stdbool.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <applibs/storage.h> | |
#include <applibs/log.h> | |
#include <applibs/gpio.h> |
This file contains 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
## Mastermind | |
## Two Players | |
## 6 colors | |
## First Guess | |
TRYS = 10 | |
MASTERMIND_CODE = ['r', 'g', 'r', 'b'] | |
import getpass |
This file contains 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
SELECT owner, | |
Count(DISTINCT( breed )) AS num_breeds, | |
Count(name) AS num_dogs | |
FROM dogs | |
GROUP BY owner | |
ORDER BY num_dogs DESC | |
LIMIT 3 |
This file contains 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
{"lastUpload":"2019-11-15T22:05:25.530Z","extensionVersion":"v3.4.3"} |
This file contains 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
#!/bin/sh | |
case "$1" in | |
resume) | |
DISPLAY=:0.0 su USER -c '/usr/bin/synclient TouchpadOff=0' ;; | |
esac | |
# /etc/pm/sleep.d/0000trackpad |
This file contains 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
# Authenticate ECR | |
eval $(aws ecr get-login --no-include-email | sed 's|https://||') | |
export AWS_PROFILE=aws-sand; eval $(aws ecr get-login --no-include-email --region us-east-1 --profile aws-sand | sed 's|https://||') | |
docker tag foobar:latest 399450685648.dkr.ecr.us-east-1.amazonaws.com/foobar:latest | |
# for each buckets | |
export BUCKET_PREFIX="s3://nfl-sandbox-datalake-" | |
array=( aws s3 ls $BUCKET_PREFIX* ) | |
for i in "${array[@]}" |
This file contains 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 unittest | |
def is_binary_search_tree(root): | |
# Determine if the tree is a valid binary search tree | |
stack = [(root, -float('inf'), float('inf'))] | |
while len(stack): | |
node, lower_bound, upper_bound = stack.pop() | |
if (node.value <= lower_bound) or (node.value >= upper_bound): | |
return False | |
This file contains 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
## https://docs.scipy.org/doc/numpy-1.13.0/user/basics.io.html | |
import np | |
## get all input | |
claims = [[int(sub_str) for sub_str in re.findall(r'-?\d+', line)] for line in inputz.split('\n')] | |
## populate an array | |
canvas = np.zeros((1000,1000)) |
This file contains 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
<!DOCTYPE html> | |
<!-- saved from url=(0086)https://8081-dot-4315443-dot-devshell.appspot.com/notebooks/datalab/docs/mlapis.ipynb# --> | |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>mlapis</title> | |
<link rel="shortcut icon" type="image/x-icon" href="https://8081-dot-4315443-dot-devshell.appspot.com/static/favicon.ico"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="./mlapis_files/codemirror.css"> | |
<link rel="stylesheet" href="./mlapis_files/style.min.css" type="text/css"> |