Skip to content

Instantly share code, notes, and snippets.

View troystribling's full-sized avatar

Troy Stribling troystribling

  • San Francisco, CA
View GitHub Profile
@troystribling
troystribling / ProtocolAssociatedType.swift
Last active April 28, 2022 20:55
A swift protocol with associated type used as type parameter in generic function
protocol Thing {
typealias argType
func doit(val:argType) -> argType
}
class IntThing : Thing {
func doit(val: Int) -> Int {
return val + 1
}
}
@troystribling
troystribling / drive_ya_nuts.scm
Created December 22, 2017 17:19
Solution to Drive Ya Nuts Puzzle
#!/usr/bin/guile -s
!#
;solution to Drive Ya Nuts http://www.samstoybox.com/toys/DriveYaNuts.html
(use-modules (ice-9 format))
(define nut (lambda (numbers)
(define center -1)
(define position 0)
(define get-numbers (lambda () numbers))
@troystribling
troystribling / Rinkeby Dev 1
Last active September 17, 2017 23:20
Rinkeby Dev 1
0x2E3Df650Bb8B6c83D17932c90f62b5394A9a6948
@troystribling
troystribling / Rinkeby Dev 2
Created September 17, 2017 23:19
Rinkeby Dev 2
0x8634187E1528eBdc652a4eCAABBD3a40fdc12F61
@troystribling
troystribling / Rinkeby
Last active September 10, 2017 19:35
Rinkeby Main
0x4BD8b52Ca2908b46210e26d55fdC5e4E24197FD0
@troystribling
troystribling / RememberMeAuthStrategy.scala
Last active January 1, 2017 08:32
Scalatra 2.2 Sentry implemented for username/password and cookie authentication.
package lib
import org.scalatra._
import org.scalatra.util.RicherString._
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
import org.scalatra.auth.{ScentrySupport, ScentryStrategy}
import net.iharder.Base64
import java.util.Locale
import io.Codec
@troystribling
troystribling / Podfile
Last active November 22, 2016 19:57
Pod file post_install hook to enable BlueCapKit DBUG output
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.name == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D DEBUG']
end
end
end
end
#!/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.
ALTREPO="apple"
# Interval for collecting vmstat, df, and CPU temperature data
STATINTERVAL=300
@troystribling
troystribling / post-commit
Last active December 21, 2015 02:18
lolcommits .git/hooks/post-commit running zsh and rvm
#!/bin/zsh
source "$HOME/.rvm/scripts/rvm"
lolcommits --capture
@troystribling
troystribling / scala.vim
Created June 15, 2013 22:37
Fix for synatstic flagging local imports as errors. in file .vim/janus/vim/tools/syntastic/syntax_checkers/scala.vim
1 "============================================================================
2 "File: scala.vim
3 "Description: Syntax checking plugin for syntastic.vim
4 "Maintainer: Rickey Visinski <rickeyvisinski at gmail dot com>
5 "License: This program is free software. It comes without any warranty,
6 " to the extent permitted by applicable law. You can redistribute
7 " it and/or modify it under the terms of the Do What The Fuck You
8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
10 "