Skip to content

Instantly share code, notes, and snippets.

let number:NSNumber? = NSNumber(longLong: 3_000_000_000) // May came from Objective-C
guard let unwrappedNumber = number as? Int else { return }
print(unwrappedNumber)
// get -1294967296 on 32-bit platform
let numberStr = "3000000000"
let anotherNumber = Int(numberStr)
print("\(anotherNumber)")
// get nil on 32-bit platform
guard let unwrappedLong = number?.longLongValue else { return }
print("\(unwrappedLong)")
http://devstreaming.apple.com/videos/wwdc/2015/217wu453thu1r1/217/217_adopting_new_trackpad_features.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/2267p2ni281ba/226/226_advanced_nsoperations.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/233l9q8hj9mw/233/233_advanced_touch_input_on_ios.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/224o6pqmtb4ik/224/224_app_extension_best_practices.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/2048w4vdjhe1i1m/204/204_apple_watch_accessibility.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/232f1zopzycv/232/232_best_practices_for_progress_reporting.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/213w6grumlfm0q/213/213_building_apps_with_researchkit.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/234reaz1byqc/234/234_building_document_based_apps.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/2313dt427pmq/231/231_cocoa_touch_best_practices.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/209c9277tttlt9
#!/usr/bin/env ruby
require 'zlib'
require 'open-uri'
require 'sqlite3'
class Torrent
# hash, name, genre, link, torrent
attr_accessor :name, :magnet, :link, :genre, :torrent
def initialize(line)
#!/usr/bin/env ruby
require 'zlib'
require 'open-uri'
require 'sqlite3'
class Torrent
# hash, name, genre, link, torrent
attr_accessor :name, :magnet, :link, :genre, :torrent
def initialize(line)
42: JAV Censored ONSD-908 Shameful Scene Collection So Embarassing Their Faces Get Fire-Red: All 13 Genr -> magnet:?xt=urn:btih:292441CD29C4ADCEE53752F20F631D5179FEA845
44: JAV Censored UMD-488 Is To Drink In The Neighborhood Of Estates Wife Erection Drugs, Had Been Been A -> magnet:?xt=urn:btih:53E3C9CC1EF25E8C31AE2CA35396EDA204796861
54: JAV Censored NANX-033 Industry Leading Beauty Salon Aroma Therapist&#039s Work Has I Have A Naughty -> magnet:?xt=urn:btih:8C1856CC780E79E2F2E3E42265708876C3B11485
59: JAV Censored UMD-490 Crotch Is Not Thought To Best Erotic Situations That Visited Unexpectedly Tsu T -> magnet:?xt=urn:btih:B6CF27B78EE6D06FE10ECFE3DA52C31C2F2EF8BD
60: JAV Censored NANX-033 Industry Leading Beauty Salon Aroma Therapist&#039s Work Has I Have A Naughty -> magnet:?xt=urn:btih:E0FC6871D5A5B63253BA8DBC556B7E601A99A8FC
65: JAV Censored BLK-216 Kira Kira BLACK GALS - 24 Hours Under The Same Roof With A Pair Of Tanned Slutt -> magnet:?xt=urn:btih:CAB698B9F5E7D259CCF19F8C393C26579277FF53
70: JAV Cens
require 'zlib'
require 'open-uri'
class Torrent
attr_accessor :name, :magnet, :link
def initialize(line)
parts = line.split("|")
@name = parts[1].strip
@magnet = "magnet:?xt=urn:btih:#{parts[0].strip}"
@venj
venj / Docker_Tomcat_deploy
Created March 16, 2015 06:32
Dockerfile to deploy app.
#TOMCAT_SERVER
#VERSIUON 1.0
FROM venj/ubuntu_java8_tomcat7
MAINTAINER venj
EXPOSE 8080
COPY myweb.war /var/lib/tomcat7/webapps/
@venj
venj / Dockerfile_Tomcat
Last active August 29, 2015 14:17
Dockerfile to make server image. Build: # docker build -t tomcat_server .
#JAVA_SERVER
#VERSION 1.0
FROM ubuntu:latest
MAINTAINER venj
#Update Ubuntu
RUN apt-get update
#Add oracle java 7 repository
@venj
venj / detect.rb
Last active August 29, 2015 14:16
A script to detect referb iPad mini 2 availablility in China.
#!/usr/bin/env ruby
# encoding = UTF-8
require "open-uri"
begin
require 'mailx' # Or main for *nix
rescue LoadError => e
STDERR.puts "Please install mail gem first."
exit 1
end
@venj
venj / cs.txt
Created February 21, 2015 07:32
venj@Wairy ~ $ diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 737A11E0-E197-423D-BA97-01E8155B55C1
=========================================================
Name: Macintosh HD
Status: Online
Size: 120473067520 B (120.5 GB)
Free Space: 18948096 B (18.9 MB)
|