Skip to content

Instantly share code, notes, and snippets.

View kgryte's full-sized avatar
😃
Working on stdlib...

Athan kgryte

😃
Working on stdlib...
View GitHub Profile
@kripken
kripken / hello_world.c
Last active January 17, 2024 12:15
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@Fil
Fil / .block
Last active November 22, 2016 19:51
Brownian Motion Constrained in Rectangle
license: gpl-3.0
border: no
scrolling: no
height: 500
@dahjelle
dahjelle / pre-commit.sh
Created July 13, 2016 16:48
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" 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

Sparky- tiny unicode sparklines

Try them in a table!

product price trend
widgets 4.37 ⠉⠉⢄⡠⠤⢄⣀⠤
@jfpuget
jfpuget / Julia_Python_perf.ipynb
Last active April 15, 2022 11:55
An exercise in Python optimization: make Python benchmarks as fast, if not faster, than Julia.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arfon
arfon / generate
Last active April 6, 2023 10:37
Let's try and generate some codemeta files.
#!/usr/bin/ruby
# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'
details = Hash.new({})
capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@mikolalysenko
mikolalysenko / MERKLEIZATION.MD
Last active October 8, 2015 19:40
Merkleization - sketchy outline

Merkleization

Introduction

Distributed systems

  • Distributed systems = Computers + relativity
  • Different machines have different clocks, perception of time, and views of the state of the system
  • Challenges: Communication failures, hardware failures, latency, bandwidth
  • All computer systems today are distributed at some level (nature obeys relativity after all), the extent to which this nature is exposed depends on the loads put upon the system.
v0.7.0 -------------------------------------------
node@v0.12.4 : FAIL wrote output to /tmp/nan-dnt-v0.12.4.out
node@v0.12.3 : FAIL wrote output to /tmp/nan-dnt-v0.12.3.out
node@v0.12.2 : FAIL wrote output to /tmp/nan-dnt-v0.12.2.out
node@v0.12.1 : FAIL wrote output to /tmp/nan-dnt-v0.12.1.out
node@v0.12.0 : FAIL wrote output to /tmp/nan-dnt-v0.12.0.out
node@v0.10.38: FAIL wrote output to /tmp/nan-dnt-v0.10.38.out
node@v0.10.37: FAIL wrote output to /tmp/nan-dnt-v0.10.37.out
node@v0.10.36: FAIL wrote output to /tmp/nan-dnt-v0.10.36.out
node@v0.10.35: PASS wrote output to /tmp/nan-dnt-v0.10.35.out[2