Skip to content

Instantly share code, notes, and snippets.

View neilkimmett's full-sized avatar

Neil Kimmett neilkimmett

View GitHub Profile
Running migrations for locations:
- Migrating forwards to 0004_auto__chg_field_location_modified_by.
> locations:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE "locations_location" ("id" serial NOT NULL PRIMARY KEY, "woeid" integer NULL, "longitude" double precision NULL, "latitude" double precision NULL, "zoom_level" integer NULL);
The error was: relation "locations_location" already exists
Error in migration: locations:0001_initial
Traceback (most recent call last):
File "/home/user/projects/world/bauhaus/manage.py", line 24, in <module>
execute_from_command_line(sys.argv)
@neilkimmett
neilkimmett / gist:6535701
Created September 12, 2013 10:51
Using a custom font with Dynamic Text
+ (UIFont *)bodyFont
{
UIFont *dynamicTextFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
UIFont *customFont = [UIFont fontWithName:@"Avenir" size:dynamicTextFont.pointSize];
return customFont;
}
//
// Created by azu on 2013/06/09.
// License MIT
#import <Foundation/Foundation.h>
#import "KWMatcher.h"
typedef NS_ENUM(NSUInteger, KWDateInequalityType){
KWDateInequalityTypeEqualToDateIgnoringTime,// ≒
#import <UIKit/UIKit.h>
@interface UIImage (ImageEffects)
- (UIImage *)applyLightEffect;
- (UIImage *)applyExtraLightEffect;
- (UIImage *)applyDarkEffect;
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
@neilkimmett
neilkimmett / hero.fish
Created October 9, 2014 14:20
When you have multiple heroku apps, for one repo, you're going to need a hero! hero production run rake db:migrate
function __hero_get_remote_names
git config --get-regexp 'remote.*.url' heroku.com | sed -E 's/^remote\.([^\.]*)\.url .*$/\1/'
end
function __hero_heroku_app_for
git config --get remote.$argv[1].url | sed -E 's/^git@heroku.com:([^.]*)\.git/\1/'
end
function __hero_completion
__hero_get_remote_names $argv[1]
class WKInterfaceButton : WKInterfaceObject {
func setTitle(title: String?)
func setAttributedTitle(attributedTitle: NSAttributedString?)
func setBackgroundColor(color: UIColor?)
func setBackgroundImage(image: UIImage?)
func setBackgroundImageData(imageData: NSData?)
func setBackgroundImageNamed(imageName: String?)
import UIKit
public func draw(size: CGSize, drawBlock: (CGContext) -> ()) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, true, 0.0)
defer {
UIGraphicsEndImageContext()
}
guard let context = UIGraphicsGetCurrentContext() else {
return nil
@neilkimmett
neilkimmett / KeyboardManagerViewController.swift
Last active February 18, 2016 10:58
Swift implementation of Soroush Khanlou's keyboard manager view controller
extension UIEdgeInsets {
static var zero: UIEdgeInsets {
return UIEdgeInsetsZero
}
}
// Inspired by "Many Controllers Make Light Work" by Soroush Khanlou
// http://khanlou.com/2016/02/many-controllers/
class KeyboardManagerViewController: UIViewController {
let scrollView: UIScrollView
{
"dependencies": {
"theo": "salesforce-ux/theo"
}
}
global:
type: color
category: color
props:
colorGray10:
value: "#f7f7f7"
comment: Default page background
colorBrand:
value: "#0055ff"
comment: ClassPass' key brand color