Skip to content

Instantly share code, notes, and snippets.

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 March 18, 2013 13:10
Simple C dynamic array library w/ radix sort implementation.
CFLAGS=-g -Wall -Wextra
all: dynamic_array
clean:
rm -rf dynamic_array *.dSYM
@dce
dce / .gitignore
Last active December 13, 2015 23:09 — forked from reagent/.gitignore
main
*.dSYM
#include <sys/stat.h>
#include "otp.h"
#define WORD_LENGTH 32
#define BLOCK_SIZE 1024
// int fseek ( FILE * stream, long int offset, int origin );
// size_t fread ( void * ptr, size_t size, size_t count, FILE * stream );
// unsigned char *SHA256 ( const unsigned char *d, size_t n, unsigned char *md );
@dce
dce / fold.rkt
Last active December 11, 2015 20:29
Better implementation of `fold`.
(define fold
(lambda (l result fun)
(cond
((null? l) result)
(else
(fold (cdr l) (fun result (car l)) fun)))))
(define fold
(lambda (l init fun)
(cond

Why Not SSL Everywhere?

  • Cost
  • Setup
  • Performance impact
  • Mixed-content warnings
  • Third-party content (ads, analytics)
  • User-embedded content
  • CDNs (CNAMEs)
@dce
dce / encode.c
Created September 24, 2012 19:04
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int index_of(char* needle, char* haystack[], int length) {
int i;
for (i = 0; i < length; i++) {
if (strcmp(haystack[i], needle) == 0) {
return i;
@dce
dce / encode.md
Created September 20, 2012 18:38

encode.c

Simple exercise for learning C:

  • Reads text from STDIN
  • By default, rotates all text by one character ("abc" => "bcd")
  • Prints to STDOUT
  • If the "-n [number]" flag is supplied, rotate by that many characters
  • If the "-d" (decode) flag is supplied, rotate in the opposite direction
  • If the "-f [filename]" flag is supplied, read from that file rather than STDIN
PATH
remote: .
specs:
paperclip-meta (0.4.2)
paperclip
GEM
remote: http://rubygems.org/
specs:
activemodel (3.2.3)
/Users/dce/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/paperclip-meta/paperclip-meta_spec.rb
/Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip/validators/attachment_content_type_validator.rb:3:in `<module:Validators>': uninitialized constant Paperclip::Validators::ActiveModel (NameError)
from /Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip/validators/attachment_content_type_validator.rb:2:in `<module:Paperclip>'
from /Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip/validators/attachment_content_type_validator.rb:1:in `<top (required)>'
from /Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip/validators.rb:2:in `require'
from /Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip/validators.rb:2:in `<top (required)>'
from /Users/dce/.rvm/gems/ruby-1.9.3-p0@paperclip-meta/gems/paperclip-3.0.2/lib/paperclip.rb:45:in `require'
from