Skip to content

Instantly share code, notes, and snippets.

View sburlot's full-sized avatar

Stephan Burlot sburlot

View GitHub Profile
@sburlot
sburlot / gist:5328122
Created April 6, 2013 23:34
Add a Run Script phase to your Xcode project and add this script to detect if you use autolayout in your 5.x target
#!/usr/bin/perl
#
# Check if we're running for 5.1 deployment and any .xib view has autolayout on.
#
use File::Find qw(find);
my $deployment = $ENV{'IPHONEOS_DEPLOYMENT_TARGET'};
my $project_dir = $ENV{'PROJECT_DIR'};
print "Deploy to $deployment\n";
@sburlot
sburlot / gist:5287657
Created April 1, 2013 20:50
Allow paste when it's disabled by a web page (iTunesConnect, I'm looking at you)
javascript:(function()%7Bvar%20inputs=document.getElementsByTagName('input');for(var%20i=0;i%3Cinputs.length;i++)%7Bif(inputs%5Bi%5D.getAttribute('type').toLowerCase()==='password')%7Binputs%5Bi%5D.setAttribute('onpaste','');%7D%7D%7D)();
@sburlot
sburlot / send_sms.php
Created December 30, 2012 14:09
PHP script to send SMS via the Infomaniak website. You need to have an account (http://www.infomaniak.ch) and add some credits to send SMS. This script was used to send sms alerts automatically, but you can use to send any sms you want (happy new year, birthday wishes, etc...)
#!/usr/bin/php
# Send SMS messages via Infomaniak.ch
# You need an Infomaniak.ch account and have some credits to send SMS
# Stephan Burlot, http://coriolis.ch Dec, 30 2012
#
<?php
// Username (your email address)
define('USER', 'user@domain.ch');
@sburlot
sburlot / gist:3046784
Created July 4, 2012 11:08
How the get the 512x512 icon for any iPhone app.
How the get the 512x512 icon for an app.
Look for this app on the itunes.apple.com website (Google is your friend)
For example, this excellent app.
http://itunes.apple.com/au/app/bancomap/id309009025?mt=8
Look for the URL of the icon in the page (it's a 175x175 picture).
I use Safari, so right click on the icon and choose "Inspect Element"
@sburlot
sburlot / awesome_list.pl
Created March 17, 2011 07:19
Add a list of users to a twitter list
#!/usr/bin/perl
use Net::Twitter;
use Data::Dumper;
$owner = "sburlot"; # <= you should put your name here
$list_name = "NSConf 2011"; # <= name of the twitter list
# put your own values below:
$consumer_key = "";
- (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef angle:(CGFloat)angle
{
CGFloat angleInRadians = angle * (M_PI / 180);
CGFloat width = CGImageGetWidth(imgRef);
CGFloat height = CGImageGetHeight(imgRef);
CGRect imgRect = CGRectMake(0, 0, width, height);
CGAffineTransform transform = CGAffineTransformMakeRotation(angleInRadians);
CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, transform);