Skip to content

Instantly share code, notes, and snippets.

View EndingCredits's full-sized avatar

William Woof EndingCredits

View GitHub Profile
@EndingCredits
EndingCredits / sed.py
Last active February 26, 2020 15:43
blackbody curve fitting, probably broken
import numpy as np
import matplotlib
import scipy
from scipy.optimize import curve_fit
#matplotlib,pgetu,emcee,astropy,warnings
#from scipy import ndimage,optimize; from scipy.optimize import fmin
import matplotlib.pyplot as plt
import sys
import datetime
import matplotlib.dates as mdates
def match(path, expr):
names = expr.split('.')[1:]
curr_name = 0
curr_path = 0
wildpath = False
while curr_path < len(path):
el = path[curr_path]
@EndingCredits
EndingCredits / ripple_qmk.c
Last active July 22, 2019 19:20
Ripple effect for HS60 keyboard > https://i.imgur.com/GBUDbji.mp4
# See below for algorithm details
# https://web.archive.org/web/20160418004149/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm
// GRID_MAX refers to the maximum position of an LED via map_led_to_point
#define LED_GRID_MAX_Y 65
#define LED_GRID_MAX_X 255
// Number to shift right by to get to ripple grid
#define GRID_COARSE 4
# Import a library of functions called 'pygame'
import pygame
import numpy as np
# Width and height of display
WIDTH = 255>>0
HEIGHT = 65>>0
# Downscale to ripple grid
SHFT = 2
@EndingCredits
EndingCredits / JSON.bnf
Last active March 20, 2024 21:56
Describing the JSON specification in psuedo-Backus-Naur Form
<json> ::= <primitive> | <container>
<primitive> ::= <number> | <string> | <boolean>
; Where:
; <number> is a valid real number expressed in one of a number of given formats
; <string> is a string of valid characters enclosed in quotes
; <boolean> is one of the literal strings 'true', 'false', or 'null' (unquoted)
<container> ::= <object> | <array>
<array> ::= '[' [ <json> *(', ' <json>) ] ']' ; A sequence of JSON values separated by commas
========================================
A simple solution
========================================
How To Make Your Own VR Headset
First, let's start with the basics. It's not a bad idea to make your own headset. The best way to make it is to buy an Oculus Rift.
========================================
import numpy as np
import tensorflow as tf
"""
# Generate some random data
# data = n x m, n = num examples, m = number features
# labels = n x c, n = num examples, c = number classes
"""
KARPATHY_CONST = 0.00025
@EndingCredits
EndingCredits / DynBoneCopy.cs
Created May 26, 2018 13:04
Script to copy dynamic bones to multiple objects
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[ExecuteInEditMode]
public class DynBoneCopy : MonoBehaviour {
public DynamicBone template;
public bool Make_Permenant;
def combine_weights(in_list):
"""
Returns a 1D tensor of the input list of (nested lists of) tensors, useful
for doing things like comparing current weights with old weights for EWC.
1.) For all elements in input list, (ln 3)
if a list combine it recursively
else leave it alone
2.) From resulting list, get all non-none elements and flatten them (ln 2)
3.) If resulting list is empty return None (ln 1)
@EndingCredits
EndingCredits / tf_ls_gradients_test.py
Created May 11, 2018 12:40
Demonstration of backprop through tf.matrix_solve_ls to learn features for random data
from __future__ import division
import numpy as np
import tensorflow as tf
# Launch the graph
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
with tf.Session(config=config) as sess:
NUM_EXAMPLES = 8096