View uglystructrawenum.swift
import Foundation
public struct RegionStruct: StringLiteralConvertible, Equatable {
let name: String
let platformId: String
let host: NSURL
typealias UnicodeScalarLiteralType = Character
View rawenumurltype.swift
import Foundation
public enum Region: String {
static var _regionURLCache = [String: NSURL]();
case One = "http://region.meh/one";
case Two = "http://region.meh/two";
case Three = "http://region.meh/three";
public func URL() -> NSURL? {
var url: NSURL? = Region._regionURLCache[self.rawValue]
View div-based-bidi-scrolling-table.html
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8"/>
<script src="/js/jquery-2.1.1.js"></script>
<style type="text/css">
.divtable {
position: relative;
overflow: auto;
View gist:131c1c6dd4e671db739a
var numbers: String = "1234567890"
for numberChar in numbers {
var numberString:String = String(numberChar)
View gist:05117207ab80627baac0
This script scans Evernote for notes, in a variety of ways, and adds references to them into OmniFocus
as inbox items. The point is to remove the necessity of reviewing your notes in Evernote to determine
if action needs to be taken by manually looking for the same sorts of things in Evernote yourself.
A typical use case scenario would be:
1. You are browsing the web and you see an article you are interested in reading later
2. You use Evernote Webclipper to save the article, perhaps simplified for reading.
3. The script eventually runs via Cron job or otherwise and adds a task to OmniFocus
View let-property-example.swift
class LetExample {
let name: String?
init(let _ name: String?) { = name
func sayMyName() -> String {
if let myName = {
return "My name is \(myName)"
View pg-multi-dict-optionals.swift
import Cocoa
let example1: [String: NSNumber] = ["a":10, "b":20, "c":30]
let example2: [String: NSNumber] = ["a":10, "c":30]
var ex = example1;
if let a = ex["a"]?.integerValue {
if let b = ex["b"]?.integerValue {
if let c = ex["c"]?.integerValue {
set -u
set -e
View round.html
<button style="width: 40em; height: 40em;">O</button>
<button style="width: 40em; height: 40em;">O</button>
View tryme.erl
loop(A, B, C, D) when B /= D ->
io:fwrite("~s~B~n", [A,B]),
loop(A, C(B), C, D);
loop(A, B, _, _) ->
io:fwrite("~s~B~n", [A, B]),