edit at
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
public static class Spatial | |
{ | |
/// <summary> | |
/// Return position above ground relatively from the prefab size | |
/// Global position | |
/// </summary> | |
/// <param name="position"></param> | |
/// <param name="prefabHeight">Prefab height needed in order to place well on top of ground</param> | |
/// <param name="transform">Transform parent</param> | |
/// <param name="layerMask">Layers to ignore</param> |
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/bash | |
python3 -m venv .my_super_env && # Yeah random name to avoid erasing local virtualenv | |
source .my_super_env/bin/activate && | |
pip install -q pyyaml && | |
python3 -c "import yaml, json, sys | |
sys.stdout.write(yaml.dump(json.load(sys.stdin)))" \ | |
< $1 > $2 || true | |
# Remove the temporary venv in any case | |
rm -rf .my_super_env || true |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Value | |
{ | |
public double Data { get; set; } | |
public double Gradient { get; set; } | |
private Action _backward; | |
private readonly List<Value> _prev; |
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
// user: Either<string, { name: string, age: number }> | |
const user = doEither(function*() { | |
// name: string | |
const name = yield* Right("test") | |
// age: number | |
const age = Math.random() > 0.5 ? yield* Right(100) : yield* Left("oopsies") | |
return { | |
name, | |
age | |
} |
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
1) Generate a private key and certificate signing request: | |
openssl genrsa -out ios_distribution.key 2048 | |
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US' | |
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create | |
- choose Production -> App Store and Ad Hoc | |
3) Download the resulting ios_distribution.cer, and convert it to .pem format: |
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
// ==UserScript== | |
// @name HackerNews GPT-Free Feed | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Hides any Hacker News story with "GPT" in its title. | |
// @author Taylor Troesh | |
// @include https://news.ycombinator.com/* | |
// @grant none | |
// ==/UserScript== |
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
alias kc='kubectl' | |
alias kclf='kubectl logs --tail=200 -f' | |
alias kcgs='kubectl get service -o wide' | |
alias kcgd='kubectl get deployment -o wide' | |
alias kcgp='kubectl get pod -o wide' | |
alias kcgn='kubectl get node -o wide' | |
alias kcdp='kubectl describe pod' | |
alias kcds='kubectl describe service' | |
alias kcdd='kubectl describe deployment' | |
alias kcdf='kubectl delete -f' |
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
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |
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
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
OlderNewer