This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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
| public class RRDrawable extends Drawable { | |
| private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); | |
| public RRDrawable(int color) { | |
| paint.setColor(color); | |
| paint.setStyle(Paint.Style.FILL); | |
| } | |
| @Override | |
| public void draw(Canvas canvas) { |
This file contains hidden or 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
| // Playground - noun: a place where people can play | |
| import UIKit | |
| enum State : String { | |
| case ASLEEP = "asleep", | |
| AWAKE = "awake", | |
| DRUNK = "drunk" | |
| } |
This file contains hidden or 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
| class MyCellSubclass: UITableViewCell { | |
| @IBOutlet var myNameLabel: UILabel!; | |
| @IBOutlet var myOtherLabel: UILabel!; | |
| // Do not include any inits, or we need to implement | |
| // the required init outself | |
| // http://stackoverflow.com/questions/25126295/swift-class-does-not-implement-its-superclasss-required-members | |
| } |
This file contains hidden or 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
| android { | |
| compileSdkVersion ... | |
| ..... | |
| // Note this section MUST appear before 'buildTypes' in the build.gradle file. | |
| signingConfigs { | |
| release { | |
| storeFile file("filename.keystore") | |
| storePassword "password" |
This file contains hidden or 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
| #!/bin/sh | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: $0 (first parameter) (second parameter) e.g. $0 foo bar"; | |
| exit 1; | |
| fi | |
| foo=$1 | |
| bar=$2 |
This file contains hidden or 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 <UIKit/UIKit.h> | |
| @interface UIImage (AddtionalFunctionalities) | |
| //TintColor... | |
| - (UIImage *)imageWithTint:(UIColor *)tintColor; | |
| //scale and resize... | |
| -(UIImage*)scaleToSize:(CGSize)size; | |
| @end |
This file contains hidden or 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
| git log --numstat --author="Ben Clayton" --since "1 month" -- *.m *.h | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' |
This file contains hidden or 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 Ben Clayton on 23/12/14. | |
| // Copyright (c) 2014 Calvium Ltd. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #import <UIKit/UIKit.h> | |
| #import "DDLog.h" | |
| @interface CustomLogFormatter : NSObject<DDLogFormatter> |
This file contains hidden or 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 <Foundation/Foundation.h> | |
| @interface NSPointerArray (CALCompact) | |
| - (void)cal_compact; | |
| @end |
OlderNewer