Skip to content

Instantly share code, notes, and snippets.


Troy Stribling troystribling

  • San Francisco, CA
View GitHub Profile
troystribling / drive_ya_nuts.scm
Created Dec 22, 2017
Solution to Drive Ya Nuts Puzzle
View drive_ya_nuts.scm
#!/usr/bin/guile -s
;solution to Drive Ya Nuts
(use-modules (ice-9 format))
(define nut (lambda (numbers)
(define center -1)
(define position 0)
(define get-numbers (lambda () numbers))
View Rinkeby Dev 2
View Rinkeby Dev 1
troystribling / Rinkeby
Last active Sep 10, 2017
Rinkeby Main
View Rinkeby
troystribling / Podfile
Last active Nov 22, 2016
Pod file post_install hook to enable BlueCapKit DBUG output
View Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D DEBUG']
View swift_build
#!/usr/bin/env bash
# Build open source Swift in a specified directory after cloning the appropriate Github repos.
# Select an alternative Github account (such as hpux735 for William Dillon's forks) to clone swift, swift-llvm, swift-lldb, and swift-corelibs-foundation repos from.
# Interval for collecting vmstat, df, and CPU temperature data
troystribling / Notify.swift
Created Nov 23, 2014
UIAlertControllerExtensions and Notification handler
View Notify.swift
import UIKit
class Notify {
class func resetEventCount() {
eventCount = 0;
UIApplication.sharedApplication().applicationIconBadgeNumber = 0
class func withMessage(message:String) {
troystribling / gist:95811ad507dc877d98ee
Created Jul 31, 2014
Find all paths to climb a digital mountain
View gist:95811ad507dc877d98ee
(ns climbing
(:require [clojure.string :as string])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; part a ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Each mountain block has 2 children it follows that for a mountain of size n
; the total paths will equal total number of block sequences from top to base
; taking one from each row which is given by p=2^(n-1)
(defn simple-path-count
troystribling / ProtocolAssociatedType.swift
Last active Apr 28, 2022
A swift protocol with associated type used as type parameter in generic function
View ProtocolAssociatedType.swift
protocol Thing {
typealias argType
func doit(val:argType) -> argType
class IntThing : Thing {
func doit(val: Int) -> Int {
return val + 1
troystribling / gist:42ec640f10317267139f
Created Mar 23, 2014
BlueCap Characteristic Profile Xcode Snippet
View gist:42ec640f10317267139f
[serviceProfile createCharacteristicWithUUID:<#UUID#>
andProfile:^(BlueCapCharacteristicProfile* characteristicProfile) { = CBCharacteristicPropertyRead | CBCharacteristicPropertyWrite;
[characteristicProfile serializeObject:^NSData*(id data) {
return nil;
[characteristicProfile afterDiscovered:^(BlueCapCharacteristic* chararacteristic) {
[characteristicProfile deserializeData:^NSDictionary*(NSData* data) {