Skip to content

Instantly share code, notes, and snippets.

💭
U+1F4A9

Ben Iofel benwaffle

View GitHub Profile
View voting-members.js
const fs = require('fs')
const assert = require('assert')
const process = require('process')
const files = fs.readdirSync('.').filter(x => x.endsWith('.csv'))
const text = files.map(f => fs.readFileSync(f).toString())
const events = [].concat(...text.map(content => content.split('\r\n').slice(6, -1).map(x => x.split(','))))
const EMAIL = 2
@benwaffle
benwaffle / Solution.java
Last active Nov 13, 2018
hackerrank triplets
View Solution.java
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
View bug.ts
type GraphQLType =
| GraphQLInt
| GraphQLList<any>
| GraphQLNonNull<any>;
interface GraphQLInt {
int: number
}
interface GraphQLList<T> {
View gist:66ccf69c2e09abb3584a4886f8a867fe
organization
- key: id
- views
- organization_reference
parameters
- organization_id=$id
View bt full.gdb
>>> thread apply all bt full
Thread 7 (Thread 0x7fffe5fbf700 (LWP 20826)):
#0 0x00007ffff612e6fd in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
No symbol table info available.
#1 0x00007ffff4c6278c in dart::Monitor::WaitMicros (this=0x7fffd001e570, micros=<optimized out>) at ../../third_party/dart/runtime/vm/os_thread_linux.cc:449
ts = {
tv_sec = 20138,
tv_nsec = 348279925
}
View Makefile
CFLAGS += -Wall -Werror -pedantic -I../../include
LDLIBS += -L../../lib -llist -lmy
pipes: pipes.c
all: pipes
clean:
$(RM) pipes
View Makefile
CFLAGS += -Wall -Werror -pedantic -I../../include
LDLIBS += -L../../lib -llist -lmy
pipes: pipes.c
all: pipes
clean:
$(RM) pipes
View run.sh
#!/bin/bash
tests=$(cat testcases.txt)
tests=${tests//$'\n'$'\n'/$'\t'}
IFS=$'\t'
result=( $tests )
cnt=0
for x in ${result[@]}; do
View regex golf - my answers
warmup: car
backtrack: d a(?! o).*re
articles and vowels: ou|j|wi
dates: ^..[^nr]
binary: ,010.*1$
contains: ta|[ae]t
binary expansion: ^1|\(1\)(?!\+0)
prime: ^(?!(xx+)\1+$)
capitals: me|[xJRf]|er
cats and dogs: [FBNV]|er|ya|io
View 0001-Make-gdb-plugin-print-type-names.patch
From 1ddb5e4010bd9e03a686eedf7abf3208faddcbaa Mon Sep 17 00:00:00 2001
From: Ben Iofel <iofelben@gmail.com>
Date: Sun, 7 Jan 2018 01:41:42 -0500
Subject: [PATCH] Make gdb plugin print type names
---
gobject/gobject_gdb.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gobject/gobject_gdb.py b/gobject/gobject_gdb.py
You can’t perform that action at this time.