Skip to content

Instantly share code, notes, and snippets.

View penso's full-sized avatar

Fabien Penso penso

View GitHub Profile
@penso
penso / keybase.md
Created March 30, 2014 20:10
keybase.md

Keybase proof

I hereby claim:

  • I am penso on github.
  • I am penso (https://keybase.io/penso) on keybase.
  • I have a public key whose fingerprint is B58C 60FB B978 B3B5 C27C E404 EE62 E221 66D7 B13A

To claim this, I am signing this object:

@penso
penso / crash.playground
Last active August 29, 2015 14:02
Xcode6-beta crash on swift code
// Copy paste this in your playground
// sent at rdar://17316238
import Cocoa
var date_string = "2014/06/14 20:05:13 +0000"
var rfc3339DateFormatter = NSDateFormatter()
rfc3339DateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
rfc3339DateFormatter.dateFormat = "yyyy/MM/dd HH:mm:ss Z"
rfc3339DateFormatter.timeZone = NSTimeZone(forSecondsFromGMT: 0)
@penso
penso / gist:43a3535c989c6b285876
Created June 14, 2014 21:50
xcode6-crash sample
import Cocoa
var options = Dictionary<String, AnyObject?>()
options["body"] = "something"
// Working
if let body : AnyObject = options["body"]! {
body
}
import Cocoa
var options = Dictionary<String, AnyObject?>()
options["body"] = "something"
var body = options["body"] as String?
import Cocoa
import Foundation
var options = Dictionary<String, AnyObject>()
options["send_at"] = "foobar"
var foo : AnyObject = options["send_at"]!
var foo2 : String = options["send_at"] as String
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500
class Foo
def initialize
@callbacks = {}
end
def on(type, &block)
@callbacks[type] = block
end
def callback(type, *args)
<link href="http://ton_url_perso" rel="author" />
<meta content="@processone" name="twitter:site" />
<meta content="http://static..../image.jpg" name="twitter:image" />
<meta content="1100" name="twitter:image:width" />
<meta content="1093" name="twitter:image:height" />
<meta content="689541045" property="fb:admins" />
<meta content="Sea Beyond 2014" property="og:title" />
<meta content="Sea Beyond is a technical event that explores the future of real-time technologies. This year we focus on mobile chat and push notifications." property="og:description" />
@penso
penso / Link removal request
Last active August 29, 2015 14:10
Karrimor asks me to add a nofollow attribute to a link to their website I've included in a blog post I did. Would love to have your comment on that request, why would they ask this?
@penso
penso / gist:39eccc756e3efe9ab84c
Last active August 29, 2015 14:10
How to sync icloud coredata?
2 Devices A and B, they both receive a push notification at the same time,
which triggers a fetch of an object on a remote server, and store the content
inside a coredata icloud enabled DB. The object has a PID stored on the remote
server.
You end up with 2 entries: one fetched on the remote server, one synced
from the other device through coredata sync.
Both devices have different NSManagedID for the same entries (you can't
automatically remove the most recent one based one it), the only thing you