Skip to content

Instantly share code, notes, and snippets.

@kevinejohn
kevinejohn / iOS-Non-Fullscreen-Video
Created October 13, 2011 03:44
iOS non-fullscreen video player
#import <MediaPlayer/MediaPlayer.h>
// Add MediaPlayer framework
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(20, 60, 200, 200)];
NSURL *movieUrl = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl];
//player.view.frame = CGRectMake(50, 50, 200, 200);
player.wantsFullScreenLayout = NO;
player.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
@kevinejohn
kevinejohn / django upload image in cURL
Created October 21, 2011 05:40
cURL upload image
curl -F image="@/Users/kj/Desktop/Icon.png" "http://0.0.0.0:8080/uploadimage/"
@kevinejohn
kevinejohn / gist:2503431
Created April 26, 2012 21:44
CopySQLiteToDesktop
while true; do find ~/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/ -name WingLite.sqlite -exec cp -f {} ~/Desktop/ \; ; sleep 1; done
@kevinejohn
kevinejohn / gist:2639642
Created May 8, 2012 21:47
Rails model generator
railroady -M | neato -Tpng > models.png
@kevinejohn
kevinejohn / gist:2919911
Created June 12, 2012 20:23
Generating SSL Cert
# Generate private key
openssl genrsa -des3 -out private.key 2048
# Remove passphrase
openssl rsa -in private.key -out private.nopass.key
# Generate CSR
openssl req -new -key private.nopass.key -out csr.pem
@kevinejohn
kevinejohn / gist:3130793
Created July 17, 2012 17:47
Restkit Post object with RootKeyPath and return object without RootKeyPath
RKObjectMapping* merchantSignupMapping = [RKObjectMapping mappingForClass:[WLMerchantSignup class]];
[merchantSignupMapping mapKeyPathsToAttributes:
nil];
[paymentProcessorObjectManager.mappingProvider addObjectMapping:merchantSignupMapping];
//[paymentProcessorObjectManager.mappingProvider setMapping:merchantSignupMapping forKeyPath:@""];
[paymentProcessorObjectManager.mappingProvider setSerializationMapping:[merchantSignupMapping inverseMapping] forClass:[WLMerchantSignup class]];
[paymentProcessorObjectManager.router routeClass:[WLMerchantSignup class] toResourcePath:SERVER_WLMERCHANTSIGNUP];
//[paymentProcessorObjectManager.mappingProvider registerObjectMapping:merchantSignupMapping withRootKeyPath:@"merchant"];
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def call_with_quiet_assets(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
call_without_quiet_assets(env).tap do
Rails.logger.level = previous_level
end
end
alias_method_chain :call, :quiet_assets
sjcl.js
passed all 4156 tests. (26 ms)
Running AES official known-answer tests...
passed all 2000 tests. (149 ms)
Running CCM mode tests...
unimplemented
Running CBC mode tests...
passed all 22 tests. (16 ms)
Running OCB 2.0 mode tests...
passed all 36 tests. (22 ms)

Keybase proof

I hereby claim:

  • I am kevinejohn on github.
  • I am kevinejohn (https://keybase.io/kevinejohn) on keybase.
  • I have a public key whose fingerprint is 97C1 387B F14B 6BDC AABA 06E3 F685 2FFB 8608 97B1

To claim this, I am signing this object:

{
"name": "PROJECT_NAME",
"description": "",
"version": "0.0.2",
"author": "Jeff Barczewski <[email protected]>",
"repository": {
"type": "git",
"url": "http://github.com/jeffbski/PROJECT_NAME.git"
},
"bugs": {