Skip to content

Instantly share code, notes, and snippets.

View TyOverby's full-sized avatar
😸

Ty Overby TyOverby

😸
View GitHub Profile
#!/bin/python
# Documentation:
# Takes a byte-stream on input and
# produces the hex values that would
# produce those bytes if ran through the
# sendstring program.
#
# example usage:
# cat smoke.bytes | python byte2str.python
@TyOverby
TyOverby / Inspect Example Output
Created March 4, 2013 06:44
These are some tools that I wrote for lab 5. They all involve debugging by printf, which I don't heavily encourage, but is sometimes necessary for quick iterations. All work is in the public domain. If a segfault comes out of this code, it is because you incorrectly linked your list.
Location: 0x7ff89bb23018
size : 32
used : 1
prev use: 1
tags : 35
Location: 0x7ff89bb23018
size : 32
used : 1
prev use: 1
#!/bin/bash
curl http://www.pixeltailgames.com/elevator/downloads/full/latest.php > packaged.zip
unzip packaged.zip /usr/bin/steam/steamapps/seth1010/garrysmod/garrysmod/gamemodes
@TyOverby
TyOverby / fact.js
Last active December 15, 2015 21:59
Lisp to Javascript compilation
var fact = (function (x) {
return (function () {
if ((x < 0)) {
return (-fact((-x)));
} else if ((x > 0)) {
return (x * fact((x - 1)));
} else if (true) {
return 1;
}
})();
@TyOverby
TyOverby / history.js
Last active December 21, 2015 01:59
Wraps an object and records all calls and property accesses and property modifications through that object.
var Record = (function () {
function Record(inner) {
this.__inner = inner;
this.__history = [];
var _this = this;
var wrapFunction = function (funcName) {
this[funcName] = function () {
@TyOverby
TyOverby / ReadOut.h
Last active December 28, 2015 06:59
Handy functions for reading integers out of a file with network byte order. Packaged in a header file for inlining.
#ifndef READ_OUT_H_GUARD
#define READ_OUT_H_GUARD
#include <stdint.h>
#include <cstdio>
#include "./fileindexutil.h"
uint64_t read64(FILE* file) {
uint64_t out;
Hello World
Error extracting zip entry 'scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map' to '/media/sf_Ty/workspace/Personal/Scala/Pipe/math/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.3.jar--627bf5f9/scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map': java.io.FileNotFoundException: /media/sf_Ty/workspace/Personal/Scala/Pipe/math/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.3.jar--627bf5f9/scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map (Operation not permitted)
at sbt.ErrorHandling$.translate(ErrorHandling.scala:11)
at sbt.IO$.next$1(IO.scala:215)
at sbt.IO$.sbt$IO$$extract(IO.scala:230)
at sbt.IO$$anonfun$unzipStream$1.apply(IO.scala:193)
at sbt.IO$$anonfun$unzipStream$1.apply(IO.scala:193)
@TyOverby
TyOverby / db_wrapper.js
Last active August 29, 2015 13:57
DB js
var dblib = require('somedb');
var wr = require('mywrapper');
var db = wr(dblib);
// query
function queryExample() {
var client = yield db.connect('postgres://postgres:1234@localhost/postgres');
var table = yield client.getTable('users');
$ rustc image.rs
image.rs:42:9: 43:6 error: cannot infer an appropriate lifetime for autoref due to conflicting requirements
image.rs:42 self.pixels.as_mut_slice()
image.rs:43 }
image.rs:42:9: 42:20 note: first, the lifetime cannot outlive the expression at 42:8...
image.rs:42 self.pixels.as_mut_slice()
^~~~~~~~~~~
image.rs:42:9: 42:20 note: ...so that automatically reference is valid at the time of borrow
image.rs:42 self.pixels.as_mut_slice()