Skip to content

Instantly share code, notes, and snippets.


Juan M Uys opyate

Block or report user

Report or block opyate

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
opyate /
Last active Jun 24, 2019
Change a git submodule remote

To change a git submodule's remote (in this case, from HTTPS to SSH):


git submodule deinit $SUB
git rm $SUB
git commit -m "removed $SUB submodule at https remote"
rm -rf .git/modules/$SUB
View env.yml
name: synth36
- conda-forge
- defaults
- backports
- backports.functools_lru_cache
- blas
- bzip2
- ca-certificates
opyate /
Last active Nov 24, 2017 week 2 code snippets
import numpy as np
# Activation functions
sigmoid = lambda x: 1 / (1 + np.exp(-x))
# tanh is just np.tanh
relu = lambda x: np.maximum(0, x)
leaky_relu = lambda x: np.maximum(0.001*x, x)
def sigmoid_derivative(x):
s = sigmoid(x)
opyate / commit-msg
Created Oct 10, 2017
JIRA code commit msg hook; presumes merges happen on remote (via PR mechanism, etc)
View commit-msg
# .git/hooks/commit-msg
test "" != "$(egrep '[A-Z]{3,}-\d+' "$1")" || {
echo >&2 Commit message requires JIRA code.
exit 1
opyate / Makefile
Created Sep 9, 2017
Quickly create a new Jekyll site, preview it, and publish it to your chosen cloud.
View Makefile
.PHONY: new pub run
docker run --rm --label=jekyll --volume=$(shell pwd):/srv/jekyll -it -p jekyll/jekyll:3.5.2 jekyll new thenewshiny
docker run --rm --label=jekyll --volume=$(shell pwd)/thenewshiny:/srv/jekyll -it -p jekyll/jekyll:3.5.2 jekyll serve
gsutil defacl ch -u AllUsers:R gs://

Keybase proof

I hereby claim:

  • I am opyate on github.
  • I am uys ( on keybase.
  • I have a public key whose fingerprint is A1D6 F8E9 BD50 3556 1583 44A4 4F35 6D93 9D11 EBF2

To claim this, I am signing this object:

opyate /
Last active Dec 2, 2015
model and maximizer
package app;
public class Cake {
private Integer weight;
private Integer value;
public Cake(Integer weight, Integer value) {
this.weight = weight;
this.value = value;
View hack.js
var contents = '<form action="" method="POST">';
contents += '<input name="secret" placeholder="Secret stuff here">';
contents += '<input type="submit" onclick="return hack()">';
contents += '<script type="text/javascript">';
contents += 'function hack() { alert("h4x0rz"); }';
contents += '</script>';
contents += '</form>';
document.getElementById('frame1').src = "data:text/html;charset=utf-8," + escape(contents);
View sleeping-barber-problem.clj
(def open-for-business? (atom true))
(def haircut-count (agent 0))
(def waiting-room (ref []))
(def waiting-room-size 3)
(defn open-shop [duration]
(do (Thread/sleep duration) (swap! open-for-business? not)))
(defn add-customers []
You can’t perform that action at this time.