Skip to content

Instantly share code, notes, and snippets.

View jeremyroman's full-sized avatar

Jeremy Roman jeremyroman

View GitHub Profile
@jeremyroman
jeremyroman / Makefile
Created December 12, 2012 02:48
llvm-brainfuck: Infrastructure code
PROGRAM := llvm-brainfuck
OBJECTS := main.o
CXX := clang++
CXXFLAGS := $(shell llvm-config --cppflags) -Wall -Werror -pedantic
LDFLAGS := $(shell llvm-config --ldflags --libs core)
all: $(PROGRAM) $(SHIM)
$(PROGRAM): $(OBJECTS)
@jeremyroman
jeremyroman / Makefile
Created December 12, 2012 17:38
llvm-brainfuck: Simple operations
PROGRAM := llvm-brainfuck
OBJECTS := main.o
CXX := clang++
CXXFLAGS := $(shell llvm-config --cppflags) -Wall -Werror -pedantic
LDFLAGS := $(shell llvm-config --ldflags --libs core)
all: $(PROGRAM) $(SHIM)
$(PROGRAM): $(OBJECTS)
$ openssl s_client -ssl3 -connect mail.csclub.uwaterloo.ca:465
[openssl certificate spew]
220 mail.csclub.uwaterloo.ca ESMTP Postfix
ehlo jbroman
250-mail.csclub.uwaterloo.ca
250-PIPELINING
250-SIZE 20971520
250-ETRN
250-AUTH PLAIN
250-AUTH=PLAIN
@jeremyroman
jeremyroman / gist:8680763
Created January 29, 2014 02:35
taurine postmortem timeline
Timeline (all times EST):
unknown (est. 6:30 PM): mcchong begins running simulations ("java a1b") on taurine using many processes, each using a great deal
7:11:48 PM: taurine runs out of memory and swap (8+2 GB), and the OOM killer is invoked for the first time. Following this, the OOM killer is repeatedly invoked at intervals of between 15 and 120 seconds).
7:45:?? PM: users begin complaining in #csc that taurine is unresponsive
7:47:32 PM: final taurine syslog entry before reboot
7:48:?? PM: m4burns, responding to similar complaints in the office, reboots taurine via ILOM
7:50:11 PM: syslog resumes after reboot
7:50:23 PM: sshd begins listening after reboot
7:50:36 PM: syscom regains access to taurine via ssh (user jbroman authenticated)
8:09:?? PM: consensus built that mcchong's java processes (which have reappeared since reboot) were responsible for the outage
Thank you for sending me CSC's information for this term.
In case you are not already aware, due to your late submission, your budget will not be considered at the budget meeting on Wednesday. The reason for this is because of MathSoc's Policy 6.3.1, which reads:
"If a club fails to submit its complete budget package on time, its package shall not be considered at the budget meeting, even if submitted before the meeting, and the club's funding shall be withheld until its budget is approved by Council."
If you have any questions or concerns regarding the above, please let me know.
Thank you,
@jeremyroman
jeremyroman / pre-commit
Created January 15, 2016 16:58
pre-commit hook
#!/bin/sh
if [[ "$(git symbolic-ref HEAD)" = "refs/heads/master" ]]; then
echo "Refusing to commit on master." >&2
exit 1
fi
@jeremyroman
jeremyroman / api_signature.cc
Created December 22, 2016 19:59
WDYT of templating APISignature::ParseArgumentsImpl
namespace {
class V8ParsingBuffer {
public:
V8ParsingBuffer(std::vector<v8::Local<v8::Value>> values, v8::Isolate* isolate)
: values_(values), isolate_(isolate) {}
void AddNull() { values_.push_back(v8::Null(isolate)); }
std::nullptr_t GetParsedArgumentBuffer() { return nullptr; }
void AddParsedArgument(v8::Local<v8::Value> value) { values_->push_back(value); }
private:
@jeremyroman
jeremyroman / api-dictionary.cc
Created March 14, 2017 20:54
v8::DictionarySchema to make reading dictionaries fast
Local<DictionarySchema> DictionarySchema::New(Isolate* v8_isolate,
Local<Value> keys[],
int keyCount) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
i::Handle<i::DictionarySchema> schema = i::DictionarySchema::New(isolate, keyCount);
for (int i = 0; i < keyCount; i++) {
Handle<Object> key = Utils::OpenHandle(keys[i]);
uint32_t array_index;
Utils::ApiCheck(key->IsName() || key->ToArrayIndex(&array_index),
class ValueSerializer {
class Delegate {
/*
* Delegate serializes the module content and returns an ID representing it.
* Using v8::WasmCompiledModule::GetTransferrableModule is recommended for efficiency,
* but a V8 client could do something else (like store the wire bytes, or store
* a URL to remote server that hosts wasm modules, or something else).
*/
virtual Maybe<uint32_t> GetWasmCompiledModuleId(
Isolate* isolate, Local<WasmCompiledModule> wasm_module);
@jeremyroman
jeremyroman / idl_union.cc
Last active April 25, 2017 01:01
union template sketch
// template definition
template <int index, typename... UnionMemberTraits>
class IDLUnionImpl {
public:
bool IsNull() const { return type_ == 0; }
protected:
int type_ = 0;
};
template <int index, typename UnionMemberTraits, typename... Rest>