View reset_branch.txt
git fetch --all | |
git reset --hard origin/{branch_name} |
View find_new_files.txt
git diff {old_branch}...{new_branch} --name-status --diff-filter=A | |
e.g. to find a enw file added since branching from master: | |
git diff master...gradie/sandbox --name-status --diff-filter=A | |
Options for `--diff-filter | |
Added (A) | |
Copied (C) |
View make_blob.py
import numpy as np | |
def make_blob_part(mean, cov, num_points=500): | |
x, y = np.random.multivariate_normal(mean, cov, num_points).T | |
return np.hstack((x.reshape(-1, 1), y.reshape(-1, 1))) | |
mean1 = [-10, 10] | |
mean2 = [-15, 5] | |
mean3 = [-9, 3] |
View sample_embeddings.txt
idx | embed_matrix | |
0 [[ 0.21143426, 1.2885487 , 0.98160927, 0.17858341], | |
1 [-0.38735983, 0.06507064, 1.31839592, -0.91412724], | |
2 [ 1.13726889, 0.48327542, 0.65075236, 0.93818869], | |
3 [1.73606298, 1.70675348, 0.31396571, 2.03089933]] |
View word2index.py
""" | |
# The map | |
word | idx | |
---------------- | |
king | 0 | |
male | 1 | |
queen | 2 | |
female | 3 | |
""" |
View word_math.py
# assigns the row from the embedding matrix to the named variable | |
king = embed_matrix[word_to_index['king']] | |
male = embed_matrix[word_to_index[‘male’]] | |
female = embed_matrix[word_to_index[‘female']] | |
queen = embed_matrix[word_to_index['queen']] | |
# the formula now uses the vectors from the embedding matrix | |
assert (king - man) + woman ≈ queen |
View gist:ddce0bfb1f7bfb3754acc0b6f2a9affe
#~/.ssh/config | |
_____________________________________________________________________________ | |
# Instructions: | |
# --------------------------------------------- | |
# the way this works is that you have to use the Host value with the ssh call | |
# Host="github.com-paulegradie" | |
# git clone git@${Host}:paulegradie/SeqPyPlot.git | |
# The default here is github.com - this is what comes with the copy/paste from github when you click | |
# the clone or download button. |
View AddPalavyrWidgetToWebsite
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Your Awesome Website</title> | |
<style> | |
#mainFrame { | |
background-color: black; |