View Arbitrary rotation of a CGImage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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); |
View awesome_list.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = ""; |
View gist:3046784
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
View send_sms.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'); |
View gist:5287657
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)(); |
View gist:5328122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"; |
View .lldbinit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://gist.github.com/mike3k/4513568 | |
# rd: print a recursive description of views | |
command regex rd 's/^[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/' | |
# prect: print the properties of a rect | |
command regex prect 's/(.+)/print (CGRect)%1/' |
View check_status.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# monitor the Apple Status page and send a notification when a new service is enabled | |
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'yaml' | |
require 'prowl' |
View NXC Configuration.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<!-- | |
BBEdit/TextWrangler codeless language module for NXC source files. | |
NXC is Not eXactly C, a programming language for the Lego Mindstorms NXT 2.0 | |
Stephan Burlot, Coriolis Technologies | |
http://coriolis.ch | |
View objcio2instapaper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
# fetches the content of an objc.io issue and send it to Instapaper | |
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch | |
# First version Oct 10, 2013 | |
# ruby was installed via homebrew, so the path to ruby is /usr/local/bin | |
# you may need to change it to the actual path of your ruby installation. | |
require 'nokogiri' | |
require 'open-uri' |
OlderNewer