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
#!/usr/bin/env ruby | |
if ARGV.length < 1 | |
puts "rack_static is a simplistic command line tool and is only usable on" | |
puts "*NIX systems -- 2013 Brandon Buck\n" | |
puts "Usage: rack_static <project_name>" | |
exit | |
end | |
# Define file contents |
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
// Created by Brandon Buck | |
// Placed into Public Domain | |
class Structure { | |
constructor(from, options = {}) { | |
this.options = Object.assign({}, Structure.defaultOptions, options); | |
this.fromEl = from; | |
this.structure = []; | |
this.process(this.fromEl); | |
} |
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
# Defines a simple DSL means for building an algorithm that follows a list of | |
# steps. Despite all algorithms being a simple set of steps that doesn't mean | |
# that this would be a prime solution for implementing said algorithm. This | |
# class is designed for implementing algorithms that follow a very defined set | |
# of steps with easy to comprehend mutations. | |
# | |
# The purpose of step definition is to force the person designed the algorithm | |
# to break each step down, ideally so that each step performs a single mutation | |
# and returns a new value. There is a means to managing a "state" for the | |
# algorithm for more complex "moving parts" algorithms or just simply caching |
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
function pidof() { | |
ps -Ac | grep -i $1 | awk '{ print $1 }' | |
} | |
function flip() { | |
perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/' <<< "$1" | |
} | |
function fuck() { | |
local to_kill=$(echo ${!#} | awk '{ print tolower($1) }') |
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
function pbgist { | |
if [ $1 == "-p" ]; then | |
gist -pP -f $2 | pbcopy | |
else | |
gist -P -f $1 | pbcopy | |
fi | |
} |
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
using UnityEngine; | |
public static class Physics2DExtensions { | |
public static void AddForce(this Rigidbody2D rigidbody2D, Vector2 force, ForceMode mode = ForceMode.Force) { | |
switch (mode) { | |
case ForceMode.Force: | |
rigidbody2D.AddForce(force); | |
break; | |
case ForceMode.Impulse: | |
rigidbody2D.AddForce(force / Time.fixedDeltaTime); |
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
+ (NSString *)signString:(NSString *)paramString { | |
NSData *paramData = [paramString dataUsingEncoding:NSUTF8StringEncoding]; | |
NSData *secretData = [kMessagePetzAPISecret dataUsingEncoding:NSUTF8StringEncoding]; | |
NSMutableData *sigData = [NSMutableData dataWithLength:CC_SHA256_DIGEST_LENGTH]; | |
CCHmac(kCCHmacAlgSHA256, secretData.bytes, secretData.length, paramData.bytes, paramData.length, sigData.mutableBytes); | |
return [sigData hexadecimalString]; | |
} |
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
# Open SQLiteMan on the iOS simulator SQL DB | |
function ios_sql { | |
local IOS_VERSION; | |
local SQLITE; | |
DEFAULT_IOS_VERSION="7.0.3" | |
IOS_VERSION=${1:-$DEFAULT_IOS_VERSION} | |
echo $IOS_VERSION | |
SQLITE=$(find ~/Library/Application\ Support/iPhone\ Simulator/$IOS_VERSION -regex ".*\.sqlite" | head -1) |
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
CFLAGS=-Wall | |
CC=cc | |
all: arr_test | |
arr_test: array.c main.c | |
$(CC) $(CFLAGS) array.c main.c -o arr_test | |
clean: | |
rm -f arr_test |
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
#import "ABRecordRefWrapper.h" | |
@interface ABRecordRefWrapper () | |
@property (nonatomic) ABRecordRef person; | |
@property (strong, nonatomic) NSArray *numbersCache; | |
@property (strong, nonatomic) NSString *firstNameCache; | |
@property (strong, nonatomic) NSString *lastNameCache; |
OlderNewer