Skip to content

Instantly share code, notes, and snippets.

View Brimizer's full-sized avatar

Daniel Brim Brimizer

  • Amazon.com
  • Seattle, WA
View GitHub Profile
@Brimizer
Brimizer / ios_post_sinatra.rb
Created June 16, 2014 18:40
iOS POST file to Sinatra
require 'sinatra'
require 'fileutils'
require 'json'
post '/:filename' do
content_type :json
puts "Opening directory"
dirname = File.expand_path("~/my_dir")
@Brimizer
Brimizer / NSLog+Extras.h
Created August 21, 2014 01:03
NSLogColor
/**
* An easy way to NSLog a message with any color you'd like.
* Requires XcodeColors, available here: https://github.com/robbiehanson/XcodeColors
* MIT License
* Created by Daniel Brim
*/
#define NSLogColor(color, args...) ExtendNSLogColor(color, __FILE__,__LINE__,__PRETTY_FUNCTION__,args);
void NSLogColor(UIColor *color, const char *file, int lineNumber, const char *functionName, NSString *format, ...);
@Brimizer
Brimizer / swift_range_convert
Created September 8, 2014 06:44
Swift Convert Range<Int> to Range<String.Index>
// Public domain.
// Free to use.
// Use like this:
var world = "Hello, world!"
let convertedRange = world.convertRange(0..<5)
world.removeRange(convertedRange)
// Converts a regular range (0..5) to a proper String.Index range.
extension String {
@Brimizer
Brimizer / git_repo_info.py
Last active November 8, 2022 13:33 — forked from igniteflow/git_python_current_branch.py
GitPython get current active branch
"""
Depends on GitPython
pip install GitPython
"""
from git import Repo
def get_current_branch_name(repo_path)
"""
Gets the name of the active Git branch as a string.
@Brimizer
Brimizer / keybase.md
Created July 26, 2016 21:42
Keybase Proof

Keybase proof

I hereby claim:

  • I am brimizer on github.
  • I am brimizer (https://keybase.io/brimizer) on keybase.
  • I have a public key whose fingerprint is 9794 98A3 975E 2816 1B51 ED73 C261 1987 1A53 037D

To claim this, I am signing this object: