Skip to content

Instantly share code, notes, and snippets.

View trptcolin's full-sized avatar

Colin Jones trptcolin

View GitHub Profile
@trptcolin
trptcolin / bf.c
Created May 10, 2012 01:17 — forked from fogus/bf.c
#include <stdio.h>
char b[30000],z[9999],*p=b,c,*a,i;
f(char*r,int s)
{
while(c=*a++)
{
if(!s)
{
(c-62)?(c-60)?(c-43)?(c-45)?(c-46)?(c-44)?0:(*p=getchar()):putchar(*p):--*p:++*p:--p:++p;
if(c==91)f(a,!*p);
@trptcolin
trptcolin / gist:2650243
Created May 10, 2012 01:13
preview3 -> preview4 repl improvements
REPL-y/jline2 features:
- blink-matching-parens
REPL-y/jline2/nREPL bugs:
- fix garbage output when editing multiple lines
- allow printing after a value is returned
- add cdoc alias
- fix clojuredocs command in a new project
- avoid warnings and errors for jlinerc and inputrc
- avoid nesting agents (Chas Emerick)
expected: Tue Apr 24 22:15:07 UTC 2012,
got: Tue Apr 24 22:15:07 UTC 2012 (using ==)
@trptcolin
trptcolin / about.md
Created April 11, 2012 20:14 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
user=> (time (dotimes [i 10000000] (reduce (fn [acc [k v]] (conj acc k)) [] {:a 1 :b 2 :c 3})))
"Elapsed time: 2782.152 msecs"
nil
user=> (time (dotimes [i 10000000] (reduce-kv (fn [acc k v] (conj acc k)) [] {:a 1 :b 2 :c 3})))
"Elapsed time: 1300.516 msecs"
nil
user=> (def size 10000)
#'user/size
user=> (def h (into {} (map vector (range size) (range size))))
colin:reply/ (master) $ lein2 clean, deps, compile
Compiling 2 source files to /Users/colin/Projects/reply/target/classes
Compiling reply.reader.jline.JlineInputReader
Compilation succeeded.
colin:reply/ (master) $ lein clean, deps, compile
Copying 17 files to /Users/colin/Projects/reply/lib
Copying 8 files to /Users/colin/Projects/reply/lib/dev
Compiling 2 source files to /Users/colin/Projects/reply/classes
Compiling reply.reader.jline.JlineInputReader
Compiling reply.main
#!/usr/bin/env ruby
require 'thread'
require 'rubygems'
require 'typhoeus'
mutex = Mutex.new
100000.times do |t|
@trptcolin
trptcolin / gist:2127208
Created March 19, 2012 21:24
Do or do not, there is no try.
# Ruby is *this* close to implementing the Yoda Spec.
module Kernel
def do_not(&block)
end
end
colin:web/ (master) $ bundle install
ERRRO: Gem bundler is not installed, run `gem install bundler` first.
colin:web/ (master) $ gem install bundler
Fetching: bundler-1.1.0.gem (100%)
Successfully installed bundler-1.1.0
1 gem installed
Installing ri documentation for bundler-1.1.0...
Installing RDoc documentation for bundler-1.1.0...
colin:web/ (master) $ bundle install
ERRRO: Gem bundler is not installed, run `gem install bundler` first.
--- a/src/clj/clojure/java/io.clj
+++ b/src/clj/clojure/java/io.clj
@@ -18,7 +18,7 @@
StringReader ByteArrayInputStream
BufferedInputStream BufferedOutputStream
CharArrayReader Closeable)
- (java.net URI URL MalformedURLException Socket)))
+ (java.net URI URL URLDecoder MalformedURLException Socket)))
(def