Skip to content

Instantly share code, notes, and snippets.

View pbexe's full-sized avatar

Miles Budden pbexe

View GitHub Profile
@pbexe
pbexe / keybase.md
Created February 1, 2020 23:30
keybase.md

Keybase proof

I hereby claim:

  • I am pbexe on github.
  • I am pbexe (https://keybase.io/pbexe) on keybase.
  • I have a public key ASDUce3hPk53RcgI8nFlaONumuzwnFeiGgG4xEofz2UaVgo

To claim this, I am signing this object:

@pbexe
pbexe / autoexec.cfg
Created June 24, 2018 15:35
CSGO autoexcec
//Rates
rate "128000"
cl_cmdrate "128"
cl_updaterate "128"
cl_interp "0"
cl_interp_ratio "1"
cl_lagcompensation "1"
//Audio
@pbexe
pbexe / index.html
Last active March 7, 2017 18:39
XMNmPy
<nav>
<div class="nav-wrapper z-depth-2 white">
<a href="#" class="brand-logo center grey-text text-darken-2">Logo</a>
</div>
</nav>
<div class="fixed-action-btn toolbar">
<a class="btn-floating btn-large red">
<i class="large material-icons">mode_edit</i>
</a>
@pbexe
pbexe / colors.js
Created February 8, 2017 09:28
d3.js colors
var colors = function(s) {
return s.match(/.{6}/g).map(function(x) {
return "#" + x;
});
};
var category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
var category20b = colors("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6");
@pbexe
pbexe / led.cpp
Created February 4, 2017 20:38
LED controller
#include <DS3231.h>
#include <LedControl.h>
#include <NewPing.h>
#define TRIGGER_PIN 9 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 8 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
@pbexe
pbexe / error.py
Created January 23, 2017 19:32
Tensorflow error
Traceback (most recent call last):
File "C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _do_call
return fn(*args)
File "C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line 1003, in _run_fn
status, run_metadata)
File "C:\Python35\lib\contextlib.py", line 66, in __exit__
next(self.gen)
File "C:\Python35\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [21758,1500] rhs shape= [14531,1500]
@pbexe
pbexe / horrible.py
Created January 9, 2017 19:47
Dynamically create variable names
_vars = 'these are some test variable names'.split(' ')
for index, var in enumerate(_vars):
s = var + ' = '+str(index)
exec(s)
print(these, are, some, test, variable, names)
@pbexe
pbexe / cipher.py
Last active November 2, 2016 20:42
Example of Caesar and Vernam cipher encoders and decoders
import math
def encode(string, rot):
phrase = string.lower().replace(" ", "")
out = ""
a = "abcdefghijklmnopqrstuvwxyz"
for char in phrase:
out += a[(a.index(char)+rot) % 26]
return out
@pbexe
pbexe / fetch.js
Created October 24, 2016 21:50
Repeated AJAX calls
(function worker() {
$.ajax({
url: './ajax/',
success: function(data) {
// Some jam
},
complete: function(data) {
setTimeout(worker, 2000);
}
});