Skip to content

Instantly share code, notes, and snippets.

View vigorouscoding's full-sized avatar

Kai Schwaiger vigorouscoding

View GitHub Profile
@yeahq
yeahq / gist:2402648
Created April 17, 2012 00:55
Run Javascript in UIWebView
// From: http://iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview
NSString *title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];
[webView stringByEvaluatingJavaScriptFromString:@"var script = document.createElement('script');"
"script.type = 'text/javascript';"
"script.text = \"function myFunction() { "
"var field = document.getElementById('field_3');"
"field.value='Calling function - OK';"
"}\";"
"document.getElementsByTagName('head')[0].appendChild(script);"];
@onlyyoujack
onlyyoujack / Xcode4TestFlightintegration.sh
Created April 9, 2012 05:51 — forked from martijnthe/Xcode4TestFlightintegration.sh
ReWrite of "Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode"
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@Jaybles
Jaybles / UIDeviceHardware.h
Created October 28, 2011 19:33
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@akisute
akisute / gist:1141953
Created August 12, 2011 12:41
Create an animated gif file from images in iOS
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
- (void)exportAnimatedGif
{
UIImage *shacho = [UIImage imageNamed:@"shacho.png"];
UIImage *bucho = [UIImage imageNamed:@"bucho.jpeg"];
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"animated.gif"];