Skip to content

Instantly share code, notes, and snippets.

View inamiy's full-sized avatar

Yasuhiro Inami inamiy

View GitHub Profile
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@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.

@tily
tily / google_image_search_rakugaki.user.js
Created May 12, 2010 14:49
google image search rakugaki
// ==UserScript==
// @name Google Image Search Rakugaki
// @namespace http://d.hatena.ne.jp/tily/
// @include http://*.google.*/images?*
// ==/UserScript==
(function() {
var DEBUG = false
var filters = [
//{
@Burgestrand
Burgestrand / download-progress.rb
Created June 27, 2010 13:55
Ruby HTTP file download with progress measurement
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|
@mdales
mdales / dvtcolorconvert.rb
Created January 24, 2011 09:34 — forked from aktowns/dvtcolorconvert.rb
Fork of aktowns' excellent little script for converting xcode3 color themes to xcode4. Just added rubygems import
#!/usr/bin/env ruby
# This script converts xccolorthemes to dtvcolorthemes for porting xcode 3.x themes to xcode 4.x
# created by ashley towns <ashleyis@me.com>
# Public domain.
# ./dvtcolorconvert <inputfile>
# spits out a .dtvcolortheme file
require 'rubygems'
require 'plist'
raise "Error: need a source file #{__FILE__} [file.xccolortheme]" if ARGV.length == 0
@zwaldowski
zwaldowski / NSObject+Blocks.h
Created May 4, 2011 12:08
Perform blocks with delays and cancellation
//
// NSObject+Blocks.h
// Filemator
//
// Created by Zachary Waldowski on 4/12/11.
// Copyright 2011 Dizzy Technology. All rights reserved.
//
@interface NSObject (Blocks)
@boctor
boctor / BaseViewController.m
Created May 5, 2011 02:08
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@pmuellr
pmuellr / gist:1004413
Created June 2, 2011 13:24
BBEdit Language Module for CoffeeScript
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.
@ekmett
ekmett / codensity-yield
Created June 8, 2011 18:40
Yield: Mainstream Delimited Continuations via Codensity
module Yield where
-- Cleaned up version of Yield: Mainstream Delimited Continuations by Roshan James and Amr Sabry from TPDC 2011
import Data.Traversable
import Control.Monad.Trans
import Control.Monad.Free
import Control.Monad.Codensity
import Control.Comonad.Trans.Store