Skip to content

Instantly share code, notes, and snippets.

@ka2n
ka2n / test.m
Created February 5, 2014 06:08
いろいろテストが面倒なときによくやるSnippet
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[NSObject cancelPreviousPerformRequestsWithTarget:[SomeClass sharedInstance]];
[[SomeClass sharedInstance] performSelector:@selector(someMethod:) withObject:someObject afterDelay:5.0];
}
---
BUNDLE_BUILD__NOKOGIRI: "--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28/ --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib"
@ka2n
ka2n / toggle.js
Last active August 29, 2015 14:02
Sqwiggle minimum mode
/*
# Save this file to /Applications/Sqwiggle.app/Contents/Resources/app.nw/assets/js/toggle.js
# And Add
<script src="assets/js/toggle.js" type="text/javascript"></script>
to /Applications/Sqwiggle.app/Contents/Resources/app.nw/index.html
*/
# coding: utf-8
# Fetch remember the milk API info
require 'pp'
require 'nokogiri'
require 'open-uri'
require 'erb'
require 'active_support/dependencies'
class String
@ka2n
ka2n / gist:ae2c0c6f596474504889
Created October 6, 2014 10:21
cocoapodで自家製.podspecを作るときの注意点
`___MAXOSX`, `.DS_Store`がzipファイル中に入っていると
`ERROR | [iOS] The `source_files` pattern did not match any file.`
`ERROR | [iOS] The `preserve_paths` pattern did not match any file.`
とか怒られるので注意
@ka2n
ka2n / minimum_configure
Created August 25, 2015 09:11
Minimum configuration file for artoolkit5.3
#!/bin/sh
MDIR=". \
lib/SRC \
lib/SRC/AR \
lib/SRC/AR/arLabelingSub \
lib/SRC/ARICP \
lib/SRC/AR2 \
lib/SRC/KPM \
lib/SRC/Util \
@ka2n
ka2n / builder.py
Created July 21, 2011 11:47
builder.py/1.7.1 quick fix for Android SDK R12
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Android Simulator for building a project and launching
# the Android Emulator or on the device
#
import os, sys, subprocess, shutil, time, signal, string, platform, re, glob, hashlib, imp
import run, avd, prereq, zipfile, tempfile, fnmatch, codecs, traceback, simplejson
from os.path import splitext
from compiler import Compiler
#lightbox{ position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
#lightbox img{ width: auto; height: auto;}
#lightbox a img{ border: none; }
#outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#imageContainer{ padding: 10px; }
#loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
#hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
#imageContainer>#hoverNav{ left: 0;}
仕事も遊びも楽しく共有できる空間を作りたい!
そんな思いから名古屋大須に誕生したのが「Art Factory」です。
Art Factoryの特徴としては、学校みたいな楽しげな雰囲気の中
コワーキングしていただける空間になっています。
システムとして学校の時間割のようなものを採用しています。
授業中(仕事や勉強をする時間)
昼休憩(一緒に食事をしたり、交流する時間)
@ka2n
ka2n / gist:2725570
Created May 18, 2012 14:36
saveNSStringAsImg
- (void)saveMessageAsImg: (NSString *)comment fileName:(NSString *) filePath
{
UIFont *font = [UIFont fontWithName:@"HiraKakuProN-W3" size:60];
CGSize size = [comment sizeWithFont: font];
UIGraphicsBeginImageContextWithOptions(CGSizeMake(size.width, size.height), NO, [[UIScreen mainScreen] scale]);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();