Skip to content

Instantly share code, notes, and snippets.

View joshgoebel's full-sized avatar
💭
Playing with GitHub status.

Josh Goebel joshgoebel

💭
Playing with GitHub status.
  • CoverMyMeds
  • Louisville, KY
View GitHub Profile
#define PROMPT(buffer, direction, index, result) \
do { \
char *after; \
char before[MAX_LINE_LEN]; \
fprintf(stderr, "(search %c%d) `%s':", direction[0], index, buffer); \
if (index > 0) {\
int i = 0; \
after = strstr(result,buffer); \
int len = strlen(result) - strlen(after); \
strcpy(before, result); \
void loop() {
ABWindow *window;
bool focused;
// pause render until it's time for the next frame
if (!(arduboy.nextFrame()))
return;
arduboy.clear();
def split(str, delimiters)
delimiters = delimiters.split(//)
result, acc = [], ""
str.split(//).each do |c|
if delimiters.include?(c)
# add the acculumator and the delimiter to our growing output array
unless acc.empty?
result << acc
acc = "" # reset accumulator
~/work/crystal-0.20.5 % PATH="../crystal-0.20.4-1/bin:$PATH" make crystal release=true
Using /Users/jgoebel/.brew/bin/llvm-config [version=3.9.1]
c++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc `/Users/jgoebel/.brew/bin/llvm-config --cxxflags`
cc -fPIC -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
LIBRARY_PATH=/Users/jgoebel/work/crystal-0.20.4-1/embedded/lib:/Users/jgoebel/.brew/lib:
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
@joshgoebel
joshgoebel / # crystal-lang - 2017-01-24_23-55-45.txt
Created January 25, 2017 04:58
crystal-lang on macOS 10.12.2 - Homebrew build logs
Homebrew build logs for crystal-lang on macOS 10.12.2
Build date: 2017-01-24 23:55:45
r = pipeline(3) \
| :dec \
| [:add, 2] \
| [:mul, 5] \
| :double
puts r.value
r = pipeline(3) do
dec
// MASKED
void drawExternalMask(int16_t x, int16_t y, const uint8_t *bitmap,
const uint8_t *mask, uint8_t frame, uint8_t mask_frame);
// = sprite UNMASKED
void drawOverwrite(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// AND (~sprite) SPRITE_IS_MASK_ERASE
void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// OR (sprite) SPRITE_IS_MASK
void drawSelfMasked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// internal masking SPRITE_PLUS_MASK
@joshgoebel
joshgoebel / ephemeral_token.rb
Created December 16, 2015 22:04 — forked from evadne/ephemeral_token.rb
Ephemeral Secure Token with JWT
class EphemeralToken
attr_reader :origin, :targets, :expires_at, :payload
class TokenInvalid < StandardError; end
class TokenExpired < TokenInvalid; end
Algorithm = 'HS512'
Secret = ENV['SECRET_EPHEMERAL_TOKEN_KEY']
ObjectToNotation = -> (target) { [target.class.model_name.name, target.id] }
NotationToObject = -> ((model_name, model_id)) { model_name.constantize.find_by_id(model_id) }

ruby-1.9.3-p448 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird who I forked this from.)

This installs a patched ruby 1.9.3-p448 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

location @503 {
add_header Maintenance "yes";
error_page 405 = /system/maintenance.html;
# Serve static assets if found.
if (-f $request_filename) {
break;
}