Skip to content

Instantly share code, notes, and snippets.

@sowawa
sowawa / sinachiku.rb
Created June 18, 2012 07:00 — forked from mattn/sinachiku.rb
sinatra on mruby
require 'HTTP'
require 'UV'
module Sinachiku
@routes = { 'GET' => [], 'POST' => [] }
def self.route(method, path, opts, &block)
@routes[method] << [path, opts, block]
end
def self.do(r)
@routes[r.method].each {|path|
@andrei512
andrei512 / GIFLoader.h
Created October 15, 2012 19:53
GIFLoader - simple GIF support for iOS
//
// GIFLoader.h
// AnimatedGifExample
//
// Created by Andrei on 10/15/12.
// Copyright (c) 2012 Whatevra. All rights reserved.
//
#import <Foundation/Foundation.h>
@tangphillip
tangphillip / PSTTextView.h
Created May 10, 2014 23:28
Objective-C: Subclassing for delegate behavior!
// A demonstration: fixing the UITextView return bug with a subclass
//
// Code for acutally fixing the bug from http://inessential.com/2014/01/07/uitextview_the_solution
#import <UIKit/UIKit.h>
@interface PSTTextView : UITextView
@end
@raphw
raphw / FieldBenchmark.java
Last active March 4, 2024 00:14
Java MethodHandle and reflection benchmark
package benchmark;
import org.openjdk.jmh.annotations.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.TimeUnit;