Skip to content

Instantly share code, notes, and snippets.

Kenn Ejima kenn

  • San Francisco
Block or report user

Report or block kenn

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
View gist:f2a0d1f52358b9b2770b
kenn / staging.rb
Created Sep 14, 2014
View staging.rb
require Rails.root.join('config/environments/production')
MyApp::Application.configure do
config.action_dispatch.tld_length = 2 # vs
View gist:67730a44a0dc5078defd
#pragma mark - Original
- (NSURLSessionDataTask *)GET:(NSString *)URLString
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
#pragma mark - Overrides
- (NSURLSessionDataTask *)GET:(NSString *)URLString
View gist:fd4cc798804508c3de6d
# cat auth.log | grep Failed | grep root | cut -d ' ' -f 11 | sort | uniq
View gist:c59256c77af5fc03b241
mysql> explain SELECT * FROM messages USE INDEX (index_messages_on_friend_id_and_id) WHERE friend_id = 100 AND (id < 1000000) ORDER BY id DESC LIMIT 10\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: messages
type: range
possible_keys: index_messages_on_friend_id_and_id
key: index_messages_on_friend_id_and_id
key_len: 8
ref: NULL
kenn / doorkeeper.rb
Created Jun 6, 2014
Doorkeeper client_secret obfuscation
View doorkeeper.rb
# config/initializers/doorkeeper.rb
Doorkeeper.configure do
client_credentials :from_obfuscated_params
module Doorkeeper
module OAuth
class Client
module Methods
def from_obfuscated_params(request)
View gist:b122e4ee58c513cbc7a3
import Foundation
class Foo : NSObject {
convenience init() {
kenn / gist:51af188d35dac8069313
Last active Aug 29, 2015
DigitalOcean Disk Performance (May 2014)
View gist:51af188d35dac8069313

Degradation of DigitalOcean Disk Performance

DigitalOcean's disk performance got order of magnitude worse. Compare the following test result with the ones that I did last year, when they started to support Virtio:

Probably DO started to throttle the I/O on the cheaper droplets, but the result is poor overall.

View Login.m
#import "NSString+SHA1HMAC.h"
NSString *client_time = [NSString stringWithFormat:@"%f",];
NSString *client_digest = [client_time SHA1HMACWithKey:kCliendSecret];
NSDictionary *parameters = @{@"grant_type":@"password",
View BlackMagic.h
+ (void) set##CMETHOD:(TYPE)val; \
static TYPE _##METHOD; \
{ @synchronized(self) { return _##METHOD; } } \
+ (void) set##CMETHOD:(TYPE)val \
{ @synchronized(self) { _##METHOD = val; } } \
You can’t perform that action at this time.