Skip to content

Instantly share code, notes, and snippets.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// perform any custom startup stuff you need to ...
// process your launch options
NSArray *keyArray = [launchOptions allKeys];
if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil)
{
// we store the string, so we can use it later, after the webView loads
NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]];
self.invokeString = [url absoluteString];
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@igrigorik
igrigorik / TweetEvent.java
Created May 27, 2011 06:19
wrapping esper with JRuby embrace
// A simple Tweet POJO:
// $> javac TweetEvent.java
public class TweetEvent {
private String user;
private String text;
private String timezone;
private int retweets;
public TweetEvent(String user, String text, String timezone, int retweets) {
@jafetsanchez
jafetsanchez / RijndaelCrypt.cs
Created July 13, 2011 11:31
Rijndael on C# and Java
#region Using
using System;
using System.Security.Cryptography;
using System.Text;
#endregion
namespace YourApp.Security.Cryptography
{
@uhlenbrock
uhlenbrock / deploy.rb
Created December 14, 2011 17:36
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@capotej
capotej / CachedMkdir.scala
Created March 4, 2012 23:48
Cached mkdir -p in scala
// Usage:
// val dircache = new CachedMkdir
// dircache.mkdirp("a/b/c/d/e") // creates the directory structure
// dircache.mkdirp("a/b/c/d/e") // does nothing
// dircache.mkdirp("a/b/Z/Y/Z") // only creates from b/ down
class CachedMkdir {
var cache = Set[String]()
@tonygambone
tonygambone / https_forward_proxy.js
Created April 19, 2012 17:02
HTTP/HTTPS forward proxy in node.js
// HTTP forward proxy server that can also proxy HTTPS requests
// using the CONNECT method
// requires https://github.com/nodejitsu/node-http-proxy
var httpProxy = require('http-proxy'),
url = require('url'),
net = require('net'),
http = require('http');
@jbrechtel
jbrechtel / project.scala
Created May 6, 2012 17:32
Scala Android project with Proguard and ActionBarSherlock
import scala.xml.{Node => XmlNode}
import scala.xml._
import java.io.FileWriter
import sbt._
import Keys._
import AndroidKeys._