This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# RocketSolver.py | |
# | |
# Created by Brian Schrader on 4/25/14. | |
# | |
# | |
## | |
import Point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?i)(star wars)|spoil(er|ing)?|((JJ)? Abrams)|(Jar Jar)|((L)(uke|eia))|Skywalker|(Han Solo)|(The)? (Force)|Darth|Jedi|Sith |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Set up a Minecraft server on a blank Linode instance. | |
# Usage: | |
# $ wget https://gist.githubusercontent.com/Sonictherocketman/221c6fad8ea76657d2b2/raw/1b565e1b5ed8b8b38efbf6d987da8986666857b8/install_mc_server.sh | |
# $ sh install_mc_server <version> | |
# | |
# author: Brian Schrader | |
# since: 2016-02-29 | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NetworkService.swift | |
import Alamofire | |
import AlamofireObjectMapper | |
import ObjectMapper | |
/*! | |
* A service that abstracts the underlying network calls and stores data | |
* to the data store, or returns them in the completion handler. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A protocol that handles listening to notifications and updating model data asycronously. | |
* | |
* To use: create a class that fulfills the protocol and fill in the updateData method. | |
*/ | |
@objc protocol BackgroundModelUpdater { | |
/** | |
* A notification identifier to be used to tell the updater to begin processing updates. | |
*/ | |
var updateNotification: String { get set } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyViewController : UITableViewController { | |
// ... | |
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
let activity = self.activities | |
// If anything isn't right, deselect the row and exit. | |
guard activity.openable else { | |
tableView.deselectRowAtIndexPath(indexPath, animated: true) | |
return | |
} | |
guard let task = self.getTask(activity) else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A script to export raw character data from Adventurer's Codex. | |
* | |
* Usage: | |
* 1. open the dev console in your prefered browser under the old Adventurer's Codex domain. | |
* 2. Copy this entire file into the console line. | |
* 3. Follow the prompts on the page. | |
* | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array+Functional+Extension.swift | |
// A set of functional methods for arrays. | |
// Created by Brian Schrader on 2/6/17. | |
import Foundation | |
extension Array { | |
/** | |
* Determine if all elements in the array are true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Given the current working directory, find all of the files of the | |
# type given and search for TODO comments in them and return a list | |
# of these items. | |
# | |
# Usage: todolist <dir> '*.py' | |
DIR=$1 | |
if [ -z "$DIR" ]; then | |
DIR="." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Interactively clean up branches in a given repository. | |
# | |
# author: Brian Schrader | |
# Usage: cd /path/to/repo && ./cleanup-git-branches | |
BRANCHES="$(git branch | sed 's/[ \*]//g')" | |
for BRANCH in $BRANCHES; do | |
CONFIRM_MSG=">>> Delete $BRANCH? [y/n, default: n]: " | |
read -en 1 -p "$CONFIRM_MSG"; |
OlderNewer