Skip to content

Instantly share code, notes, and snippets.

David Eisinger dce

Block or report user

Report or block dce

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dce
dce / sunspot.rb
Created Nov 20, 2018
Sunspot/RSpec configuration (borrows heavily from https://dzone.com/articles/install-and-test-solrsunspot)
View sunspot.rb
require 'sunspot/rails/spec_helper'
require 'net/http'
try_server = proc do |uri|
begin
response = Net::HTTP.get_response uri
response.code != "503"
rescue Errno::ECONNREFUSED
end
end
View keybase.md

Keybase proof

I hereby claim:

  • I am dce on github.
  • I am dce (https://keybase.io/dce) on keybase.
  • I have a public key whose fingerprint is 7884 224B E2F6 0E0F 1CE4 B34B 9FDB 12C7 D60E 357A

To claim this, I am signing this object:

View closure.go
package main
import (
"fmt"
)
func make_addr(y int) (func(int) int) {
return func(x int) (int) {
return x + y
}
@dce
dce / decrypt.sh
Created Aug 29, 2013
encrypt.sh sensitive_information.txt "the crow flies at midnight"
View decrypt.sh
#!/bin/sh
openssl aes-256-cbc -d -a -pass "pass:$2" -in $1 -out `echo $1 | sed 's/\.enc$//'`
@dce
dce / decrypt.sh
Created Jun 14, 2013
Encrypt/decrypt a file
View decrypt.sh
#!/bin/sh
openssl aes-256-cbc -d -a -pass "pass:$2" -in $1 -out `echo $1 | sed 's/\.enc$//'`
View recursion.rb
require "test/unit"
def balanced?(string)
# ...
end
def count_change(money, coins)
# ...
end
@dce
dce / string_add.c
Last active Dec 15, 2015
Add two strings of integers
View string_add.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#define CTOI(c) c - '0'
#define ITOC(i) '0' + i
char *
add(char *n1, char *n2)
View Makefile
CFLAGS = -g -Wall -Wextra
all:
make rope
gcc -o main main.c rope.o
rope:
gcc -o rope.o -c rope.c
clean:
@dce
dce / Makefile
Created Mar 18, 2013
Simple C dynamic array library w/ radix sort implementation.
View Makefile
CFLAGS=-g -Wall -Wextra
all: dynamic_array
clean:
rm -rf dynamic_array *.dSYM
You can’t perform that action at this time.