Skip to content

Instantly share code, notes, and snippets.

View ngs's full-sized avatar
🎣
Fly Fishing

Atsushi NAGASE ngs

🎣
Fly Fishing
View GitHub Profile
//
// NSDate+RFC3339.h
//
// Created by Atsushi Nagase on 3/7/11.
// Copyright 2011 LittleApps Inc. All rights reserved.
//
@interface NSDate (RFC3339)
/**
This code snippet shows how an Android activity can trigger a web based auth using webview and then use
the cookies from there to make subsequent calls to an API (since the api is checking the cookies to detect
sign in)
MyApplication: The root "controller" and the first activity in my app
OAuthLogin: A class that handles the web based login.
It montors the url change and if the user had been redirected to
a "success" page it sends out the cookie string to the root controller
Once the controller has the cookie, it sets those on the service that
@ngs
ngs / gist:2562945
Created April 30, 2012 21:48 — forked from dustMason/gist:1252515
Fix precompilation DB dependency
namespace :assets do
# Prepend the assets:precompile_prepare task to assets:precompile.
task :precompile => :precompile_prepare
# This task will be called before assets:precompile to optimize the
# compilation, i.e. to prevent any DB calls.
task 'precompile_prepare' do
# Without this assets:precompile will call itself again with this var set.
# This basically speeds things up.
# ENV['RAILS_GROUPS'] = 'assets'
@ngs
ngs / Create Mac Icons.jsx
Created May 22, 2012 23:26 — forked from ma11hew28/Create Icons.jsx
Photoshop Script to Create iPhone Icons from iTunesArtwork
/** @see http://bit.ly/VTacev */
// Turn debugger on. 0 is off.
// $.level = 1;
var OUTPUT_FOLDER_NAME = "icons"
, icons = [
["icon_32x32", 16],
["icon_32x32", 32],
["icon_128x128", 128],
@ngs
ngs / link_header.py
Created May 31, 2012 19:25 — forked from mnot/link_header.py
link_header.py: HTTP Link header parsing
@ngs
ngs / RunPlatformUnitTests.sh
Created June 16, 2012 03:06 — forked from sgleadow/RunPlatformUnitTests.sh
Modified shell script to run OCUnit and Kiwi tests on the command line.
#!/bin/sh
##
# Copyright 2008 Apple Inc.
# All rights reserved.
#
# iPhoneSimulator platform
# This script runs all of the unit tests for the target test bundle specified by the passed-in environment.
# This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases.
##
#
@ngs
ngs / gist:4011900
Created November 4, 2012 13:27 — forked from CodeIQ/gist:3863315
Find Memory Leaks
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
@interface MemoryLeakTestTableViewController : UITableViewController
{
NSMutableArray *dataForCellArray1;
}
@property (retain, nonatomic) NSMutableArray *dataForCellArray2;
@property (retain, nonatomic) NSMutableArray *dataForCellArray3;
@charset "utf-8";
body {
background: #222;
}
body, table, form, input, td, th, p, textarea, select {
font-family: Helvetica, sans-serif;
color: #0d0;
}
@ngs
ngs / Rakefile
Last active August 29, 2015 14:06 — forked from kishikawakatsumi/Rakefile
require "rubygems/version"
require "rake/clean"
require "date"
# Application info
APP_NAME = "Ubiregi2"
SDK = "iphoneos"
WORKSPACE = File.expand_path("#{APP_NAME}.xcworkspace")
SCHEME = "#{APP_NAME}-Release"
INFO_PLIST = File.expand_path("#{APP_NAME}/#{APP_NAME}-Info.plist")
@ngs
ngs / .travis.yml
Last active December 15, 2021 17:01 — forked from kishikawakatsumi/.travis.yml
language: objective-c
cache:
directories:
- vendor/bundle
- Pods
install:
- bundle install --path=vendor/bundle --binstubs=vendor/bin
- bundle exec pod install
script:
- '[ ! -z $(echo ${TRAVIS_BRANCH} | grep "^release.*$") ] && CONFIG=release || CONFIG=adhoc'