Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View hmcfletch's full-sized avatar

Les Fletcher hmcfletch

View GitHub Profile
@hmcfletch
hmcfletch / AFRailsHTTPClient.h
Created May 1, 2012 18:42
AFRailsHTTPClient
//
// AFRailsHTTPClient.h
// TopHatter
//
// Created by Leslie Fletcher on 1/30/12.
// Copyright (c) 2012 Blippy. All rights reserved.
//
#import "AFHTTPClient.h"
#!/bin/bash
# git-branch-status
# * originally by http://github.com/jehiah
# * "s'all good!" message by http://github.com/kd35a
# * ANSI colors by http://github.com/knovoselic
# * column formatting, filters, and usage by http://github.com/bill-auger
# this script prints out pretty git branch sync status reports
@hmcfletch
hmcfletch / ColorHelper.h
Created January 23, 2012 05:59
A bunch of objective-c color helpers
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
// generate a UIColor from rgb and alpha values
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGB(r, g, b) RGBA(r, g, b, 1.0)
// generate a UIColor
#define GRAYSCALEA(rgb, a) RGBA(rgb, rgb, rgb, a)
#define GRAYSCALE(rgb) GRAYSCALEA(rgb, 1.0)
// generate a UIColor from a hex and an alpha value
@hmcfletch
hmcfletch / config.yml
Created September 21, 2018 19:40
An example Circle CI workflow for a Ruby on Rails app
version: 2
jobs:
checkout_and_deps:
docker:
- image: circleci/ruby:2.5.1-node-browsers
steps:
- checkout
- run:
@hmcfletch
hmcfletch / state_abbr_to_name.rb
Created June 2, 2011 23:14
Ruby hashes for converting states to abbreviations and back
STATE_ABBR_TO_NAME = {
'AL' => 'Alabama',
'AK' => 'Alaska',
'AS' => 'America Samoa',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',