Skip to content

Instantly share code, notes, and snippets.

View fwhenin's full-sized avatar

Freddy Henin fwhenin

  • Autosoft Inc.
  • United States
View GitHub Profile
@fwhenin
fwhenin / UDWrapper.swift
Created December 18, 2014 20:22
NSUserDefaults Wrapper in swift
//
// UDWrapper.swift
// DMS
//
// Created by Freddy on 12/18/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
import Foundation
@fwhenin
fwhenin / OrderedDictionary.swift
Created December 18, 2014 20:23
Swift Ordered Dictionary
//
// OrderedDictionary.swift
// DMS
//
// Created by Freddy on 12/12/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
import Foundation
@fwhenin
fwhenin / build.sh
Last active August 29, 2015 14:14 — forked from jonah-williams/build.sh
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@fwhenin
fwhenin / KeyValueTableViewCell.swift
Created January 6, 2015 20:27
Increase the size of the textLabel in UITableViewCellStyle.Value2
override func layoutSubviews() {
super.layoutSubviews();
var offset = CGFloat(20);
var labelWidth = CGFloat(120);
var space = CGFloat(5);
var labelHeight = CGFloat(21);
var cellHeight = CGFloat(44);
@fwhenin
fwhenin / KeychainService.swift
Created December 18, 2014 20:22
iOS Keychain Wrapper
//
// KeychainService.swift
// DMS
//
// Created by Freddy on 10/30/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
import UIKit
import Security
@fwhenin
fwhenin / DDLogWrapper.h
Created December 18, 2014 15:58
CocoaLumberJack wrapper for Swift
//
// DDLogWrapper.h
// DMS
//
// Created by Freddy on 12/18/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
#import <Foundation/Foundation.h>
@fwhenin
fwhenin / package.json
Last active August 29, 2015 14:10
Boilerplate package.json
{
"name" : "package-name",
"preferGlobal": "true",
"version" : "0.0.1",
"author" : "name <email>",
"description" : "package-description",
"contributors": [
{
"name" : "contributer-name",
@fwhenin
fwhenin / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fwhenin
fwhenin / HexUIColor.m
Created May 14, 2014 18:43
Hex to UIColor Method
+(UIColor *)convertToUIColorFromHex:(NSString *) hex{
NSScanner *scanner = [NSScanner scannerWithString:hex];
unsigned int baseColor;
[scanner scanHexInt:&baseColor];
CGFloat red = ((baseColor & 0xFF0000) >> 16) / 255.0f;
CGFloat green = (baseColor & 0x00FF00) >> 8) / 255.0f;
CGFloat blue = (baseColor & 0x0000FF)) / 255.0f;
UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:1.0f];