Skip to content

Instantly share code, notes, and snippets.

qwzybug / amtrak.rb
Last active October 11, 2017 13:42
View amtrak.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'cgi'
require 'httparty'
require 'nokogiri'
@url = ""
@train = '523'
View gist:3853d71672d4c16b17b2db2928c3b745
Progress: 80/83
-- While building package openvr-hs- using:
/Users/d/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal- --verbose --builddir=.stack-work/dist/x86_64-osx/Cabal- build lib:openvr-hs --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/d/Developer/rumpus/.stack-work/logs/openvr-hs-
Configuring openvr-hs-
Dependency base == using base-
Dependency gl-pal == using gl-pal-
View sdf linear paths.swift
//: Playground - noun: a place where people can play
import Cocoa
import CoreGraphics
extension CGColor {
static func white(_ value: CGFloat = 1.0, alpha: CGFloat = 1.0) -> CGColor {
return CGColor(red: value, green: value, blue: value, alpha: 1.0)
qwzybug / sdf.swift
Created June 22, 2016 07:05
Generate distance field bitmaps from paths in Swift
View sdf.swift
//: Playground - noun: a place where people can play
import Cocoa
import CoreGraphics
import ImageIO
typealias LineSegment = (CGPoint, CGPoint)
extension CGPoint {
func distance(to point: CGPoint) -> CGFloat {
View social sports.txt
JIM and his GIRLFRIEND are getting
ready for THE BIG GAME. JIM is wearing
across the back.
The front door opens. SAM enters,
carrying BREWSKIS.
View cons.swift
// Cons lists are kind of like linked lists
enum List<T> {
case Empty
indirect case Cons(T, List<T>) // doesn't compile yet. will soon.
mutating func add(item: T) {
switch self {
case .Empty:
self = .Cons(item, .Empty)
View The

It wasn't a voice but more like something you just knew, all of a sudden, like a new sense.

Your urine flow is down 4 percent year over year. This is a common early sympton of enlarged prostate and prostate cancer. Your estimated time to further symptons is 3.2 years.

He sighed, angry at himself, like someone twenty years before might have sighed at an unpaid parking ticket come back for collections. Not that long ago it felt like 3.5, even 4 years. Anyway it wasn't hurting yet, though he supposed it probably would soon; these feelings were rarely wrong, if you gave them enough information. Anyway he didn't have enough spare cash at the moment to upgrade his medical plan to an interactive one. He fucking should though, he told himself, he was almost 30 and should be more responsible by now. Or was that just another one of those other feels, maybe a sponsored one? He thought a moment. No, this was nonspecific, a real feeling.

He finished pissing, washed and dried his hands.

He had friends who could affor

qwzybug / hasklike.swift
Created February 10, 2015 20:44
countdown to haskell-style commas in 3... 2... 1...
View hasklike.swift
for userDict in userList {
if let
id = userDict["id"] as? Int
, name = userDict["name"] as? String
, email = userDict["email"] as? String
, address = userDict["address"] as? [String: AnyObject]
users.append(User(id: id, name: name, ...))
qwzybug / dev_random.swift
Last active August 29, 2015 14:13
noodling with devices & generators in swift
View dev_random.swift
#!/usr/bin/env swift
import Foundation
class Dev {
let desc: Int32
var data = NSMutableData(length: 1)!
init(_ name: String) {
desc ="/dev/\(name)", O_RDONLY)
qwzybug /
Created January 4, 2015 09:11
By episode 3, Janet and Larry's relationship remains obscure.

STEVE is a skink. JANET is a sparrow. LARRY is a beaver.

STEVE and JANET enter, continuing a conversation. LARRY is eating a sandwich.

Steve: Oh, that's Larry. Don't mind him, he's a child pornography enthusiast.

Larry (correcting him): Pedophile.