Skip to content

Instantly share code, notes, and snippets.

View sugendran's full-sized avatar

Sugendran Ganess sugendran

View GitHub Profile
@sugendran
sugendran / gist:4056604
Created November 11, 2012 22:51
Fade between view controllers in the UINavigationController
// will use a fade transition for the next push or pop on the view controllers stack
-(void) setNavigationTransition
{
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
}
@sugendran
sugendran / gist:4634031
Created January 25, 2013 12:21
sugendran.net
[0,7,5,10,4,15,2,13,4,16,4,10,1].map(function(a){return this[a];},typeof("")+typeof(0)+NaN+"d.").join("")
@sugendran
sugendran / gist:4739011
Created February 8, 2013 13:20
Create a git remote in your dropbox folder
cd ~/Dropbox
mkdir -p git/proj1
cd git/proj1
git init --bare
@sugendran
sugendran / gist:4773412
Created February 12, 2013 21:08
CREATE UUID in Objective-C with ARC
// CREATE UUID in Objective-C with ARC
NSString* createUUID()
{
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStr = CFUUIDCreateString(kCFAllocatorDefault, uuid);
NSString *result = [NSString stringWithString:(__bridge NSString*)uuidStr];
CFRelease(uuid);
CFRelease(uuidStr);
return result;
@sugendran
sugendran / gist:4974828
Created February 18, 2013 02:42
build and uplaod to test flight
#!/bin/sh
# A script to build your iOS app and send it to test flight
# Distributed on an as is and I accept no responsiblity for what it does licence
# For more info: http://www.abandonedexpression.com/2011/06/continuous-integration-with-xcode.html
# I'm assuming that your project is in the src directory of your repository
PROJECT_DIRECTORY="${PWD}/src"
# The target we're building
TARGET_NAME="My Project"
# The name for the .app and .ipa files that get created
(function (text) {
var canvas = document.createElement("canvas");
canvas.width = 600;
canvas.height = 100;
var ctx = canvas.getContext("2d");
ctx.font = "28px monospace";
ctx.textBaseline = "top";
ctx.textAlign = "start";
var w = Math.ceil(ctx.measureText(text).width) + 2;
var h = 45;
@sugendran
sugendran / mkgraphics.js
Last active March 28, 2017 22:09
For NativeScript - Process all images from a source folder and creates suitably sized images in the app's target folder
// based around the setup in https://www.npmjs.com/package/nativescript-media-generator
// all %s come from it
// npm install imagemagick async
// update the source and target paths
// then run node mkgraphics.js
// It should put correctly sized images in the right folders
var im = require('imagemagick');
var fs = require("fs");
var path = require("path");
@sugendran
sugendran / README.md
Last active August 12, 2021 09:54
webpack-stats-to-edge