Skip to content

Instantly share code, notes, and snippets.

View inamiy's full-sized avatar

Yasuhiro Inami inamiy

View GitHub Profile
#!/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -i -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
import Foundation
class JSON {
struct Path: Printable {
enum Element {
case Index(Int)
case Key(String)
import Foundation
class A0 { }
class A1: A0 { }
class A2: A1 { }
class Array<X> {
func get() -> X { fatalError() }
func set(x: X) -> () { fatalError() }
}
# name: Agnoster
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for FISH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
## Set this options in your config.fish (if you want to :])
@nojimage
nojimage / app_controller.php
Created November 27, 2009 12:32
cakephp authコンポーネントのサンプル
<?php
/**
* AppController
*
* PHP version 5
*
* @copyright Copyright 2009, nojimage
* @link http://php-tips.com/
* @package app
* @subpackage app
@henrik
henrik / README.markdown
Created April 1, 2010 20:08
Core Graphics rounded rectangle with gradient background on the iPhone, NSTokenField/NSTokenFieldCell style. Kind of like in Mail.app.

Rounded rectangle with gradient background on the iPhone, NSTokenFieldCell style.

Screenshot

Unlike my previous implementation, this one is drawn inside a single view using Core Graphics. It can thus be used for optimized, fast-scrolling cells per Apple's TableViewSuite sample.

The gradient shades are changed from that implementation, too, and the border itself is gradiented (by drawing a smaller rectangle inside a larger one that becomes the border).

You need to include the uicolor-utilities category by Ars Technica.

/* ios version
NSDictionary *contextDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"kCIContextUseSoftwareRenderer"];
CIContext *ciContext = [CIContext contextWithOptions:contextDict];
NSDictionary *detectorDict = [NSDictionary dictionaryWithObject:@"CIDetectorAccuracyHigh" forKey:@"CIDetectorAccuracy"];
CIDetector *detector = [CIDetector detectorOfType:@"CIDetectorTypeFace" context:ciContext options:detectorDict];
@sidwarkd
sidwarkd / .gitignore
Created November 27, 2011 03:35
Very basic Node.js app using MongoLab and Heroku
node_modules
@jkubicek
jkubicek / gist:1503941
Created December 21, 2011 00:24
Lorem ipsum generator for Obj-C
#import <Foundation/Foundation.h>
#define DEBUG
//#undef DEBUG
//>>>>> snip
#ifdef DEBUG
static inline NSString * GenerateLorumStringCharCount(NSUInteger count)
{
NSString *lorum = @"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ";
@gerad
gerad / xcode-git-version.sh
Created April 5, 2012 01:03 — forked from jpwatts/xcode-git-version.sh
This Xcode 4 build phase script automatically sets the version and short version string of an application bundle based on information from the containing Git repository.
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode 4, add the contents to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset

DON'T BE A DICK PUBLIC LICENSE

Version 1, December 2009

Copyright (C) 2009 Philip Sturgeon email@philsturgeon.co.uk

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.