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:
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 |
import Cocoa | |
var options = Dictionary<String, AnyObject?>() | |
options["body"] = "something" | |
var body = options["body"] as String? |
import Cocoa | |
var options = Dictionary<String, AnyObject?>() | |
options["body"] = "something" | |
// Working | |
if let body : AnyObject = options["body"]! { | |
body | |
} |
// 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) |
I hereby claim:
To claim this, I am signing this object:
curl -d user_credentials=MY_CREDENTIALS\ | |
-d "notification[message]=my message" \ | |
-d "notification[long_message]=<b>Some HTML for the full layout page notification</b>" \ | |
-d "notification[title]=A notification title" \ | |
-d "notification[subtitle]=A notification subtitle" \ | |
-d "notification[long_message_preview]=the notif preview" \ | |
-d "notification[action_loc_key]=Approve me" \ | |
https://www.appnotifications.com/account/notifications.xml |
mysql> desc relationships; | |
+-----------+------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-----------+------------+------+-----+---------+-------+ | |
| user_id | int(11) | NO | PRI | 0 | | | |
| friend_id | int(11) | NO | PRI | 0 | | | |
| status | tinyint(4) | NO | | 0 | | | |
+-----------+------------+------+-----+---------+-------+ | |
3 rows in set (0.00 sec) |
#define TWEET_MAX_LENGTH 140 | |
#define TWEET_URL_HTTP_LENGTH 22 | |
#define TWEET_URL_HTTPS_LENGTH 23 | |
+ (NSInteger) remainingChars:(NSString *)text { | |
NSInteger result = TWEET_MAX_LENGTH - [text length]; | |
NSError *error = nil; | |
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"https?://(\\S+)" | |
options:0 | |
error:&error]; |
server { | |
listen 80; | |
server_name blog.penso.info; | |
access_log /var/log/nginx/penso.access.log; | |
root /www/penso.info/htdocs; | |
index index.html index.htm; | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { |
# put this in lib/realtime_analytics.rb | |
# | |
# Then add in your config/routes.rb: | |
# mount AnalyticsSSE => '/realtime-analytics' | |
require 'em-hiredis' | |
class AnalyticsSSE < Sinatra::Base | |
include Sinatra::SSE | |
get '/' do | |
sse_stream do |out| | |
redis = EM::Hiredis.connect("redis://#{Settings[:redis_host]}:#{Settings[:redis_port]}") |