View necto-viz.py
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
# https://stackoverflow.com/questions/52468956/how-do-i-visualize-a-net-in-pytorch | |
import os | |
import numpy as np | |
import torch | |
from torch.distributions import Categorical | |
import torch.nn.functional as F | |
from rlgym.utils.gamestates import GameState, PlayerData, PhysicsObject | |
from training.obs import NectoObsBuilder |
View main.py
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
import machine, network, time, dht, mqtt | |
# mqtt: https://github.com/micropython/micropython-lib/blob/master/umqtt.simple/umqtt/simple.py | |
## SECRETS | |
WIFI_NAME='<WIFI SSID>' | |
WIFI_PASS='<WIFI PASSWORD>' | |
MQTT_HOST='io.adafruit.com' | |
MQTT_PORT=1883 | |
MQTT_USER='<ADAFRUIT USERNAME>' | |
MQTT_PASS='<ADAFRUIT IO KEY>' |
View main.cpp
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
// If you're building this code from Arduino IDE, you wont need to import Arduino.h | |
#include "Arduino.h" | |
#include "soc/rtc.h" | |
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */ | |
#define TIME_TO_SLEEP ((60 * 60) * 1) /* Time ESP32 will go to sleep (in seconds) */ | |
// Multiple ways to run this code to produce different reports | |
#define MODE_SLEEP 1 | |
#define MODE_DIAG 2 |
View dump-css.js
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
/* Simmer.js https://github.com/gmmorris/simmerjs/ */ | |
var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.owns=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},$jscomp.getGlobal=function(t){return"undefined"!=typeof window&&window===t?t:"undefined"!=typeof global&&null!=global?global:t},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(t,e,n,r){if(e){for(n=$jscomp.global,t=t.split("."),r=0;r<t.length-1;r++){var o=t[r];o in n||(n[o]={}),n=n[o]}(e=e(r=n[t=t[t.length-1]]))!=r&&null!=e&&$jscomp.defineProperty(n,t,{configurable:!0,writable:!0,value:e})}},$jscomp.polyfill("Object.assign",function(t){return t||function(t,e){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)$jscomp.owns(r,o)&&(t[o]=r[o]) |
View sideeffect.py
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
#!/usr/bin/env python | |
#### MIT Licence | |
# Copyright 2020 Josh "nevercast" Lloyd | |
# This notice must remain intact for all copies or substantial portions of the Software | |
#### | |
# First release: 2020-08-10 | |
from __future__ import print_function | |
import ast | |
import sys |
View pixels.py
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
# Copyright public licence and also I don't care. | |
# 2020 Josh "NeverCast" Lloyd. | |
from micropython import const | |
from esp32 import RMT | |
# The peripheral clock is 80MHz or 12.5 nanoseconds per clock. | |
# The smallest precision of timing requried for neopixels is | |
# 0.35us, but I've decided to go with 0.05 microseconds or | |
# 50 nanoseconds. 50 nanoseconds = 12.5 * 4 clocks. | |
# By dividing the 80MHz clock by 4 we get a clock every 50 nanoseconds. |
View babel.js
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
/** | |
* Azure Functions can sometimes share a global scope to save memory (More than one function runs in the same interpreter). | |
* When this occurs, babel will try to load twice. This is bad. | |
* | |
* This file acts as a mediator to prevent it loading twice and always logs the result for my interest. | |
* Inside my webpack.config.js, instead of 'babel-polyfill', I have 'src/polyfill/babel' (this file). | |
*/ | |
if (global._babelPolyfill) { | |
/* Polyfill is already loaded */ | |
if (console && console.warn) { |
View index.js
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
import {AppRouter, RouterConfiguration} from "aurelia-router"; | |
export function configure(config) { | |
const router = config.container.get(AppRouter); | |
const routerConfig = config.container.get(RouterConfiguration); | |
routerConfig | |
.map([{ route: "foo", moduleId: "features/foo/foo", name: "foo", nav: true, title: "foo" }]) | |
.exportToRouter(router); | |
} |
View gist:3d2c8d64b707bc05b0ff
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
didInsertElement: function() { | |
Em.$(document) | |
.on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) { | |
console.log('HAVE CAKE'); | |
}); | |
}, |
View gist:906e974f2a2de59b451c
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
[19:59:32] [Server thread/INFO]: NeverCast issued server command: /mcrank | |
[19:59:32] [pool-3-thread-81/WARN]: Exception in thread "pool-3-thread-81" | |
[19:59:32] [pool-3-thread-81/WARN]: org.apache.commons.lang.UnhandledException: Plugin mcMMO v1.5.01-SNAPSHOT-b3632 generated an exception while executing task 2653 | |
at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56) | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) | |
at java.lang.Thread.run(Unknown Source) | |
Caused by: java.lang.NullPointerException | |
at java.util.EnumMap.typeCheck(Unknown Source) | |
at java.util.EnumMap.put(Unknown Source) |
NewerOlder