Skip to content

Instantly share code, notes, and snippets.

View threetreeslight's full-sized avatar

threetreeslight threetreeslight

View GitHub Profile
$ rails new hoge -T --skip-bundle
$ vim ./.rvmrc
rvm use 1.9.3@hoge
$ vim ./.pryrc
begin
require 'hirb'
rescue LoadError
# Missing goodies, bummer
// Detect links pattern
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
// Wrap the matched strings with `<span class="fake-link"></span>`
$('body').html($('body').html().replace(exp, "<span class='fake-link'>$1</span>"));
$('.fake-link').each(function() {
// Extra job: Check if parent is an anchor
if ($(this).parent().is('a')) {
// If `true`, then unwrap the original anchor which has been written by default from `.fake-link`
@threetreeslight
threetreeslight / .gitignore
Created February 15, 2014 10:06
objective-c gitignore
# OS X
.DS_Store
# Xcode
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
*.xcworkspace/*
!*.xcworkspace/contents.xcworkspacedata
build/
*.pbxuser
@threetreeslight
threetreeslight / AppDelegate.m
Last active August 29, 2015 13:58
ReproInsight
#import <Repro/ReproInsight.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[ReproInsight setupWithToken:@"YOUR_APP_TOKEN"];

Test of Controller

GET

  • assing valiables
    • exist
    • not exist (if necessary or have possible)
  • render_template
    • assign valiable exist
    • not exist (if necessary or have possible)
function () {
TouchSequencesController = {
sequences: [],
runningSequences: [],
preShowTouchTime: .3,
nextTouchSequence: 0,
layer: new Kinetic.Layer,
isPaused: !1,
scale: 1,
create: function (e, t, n, i) {
@threetreeslight
threetreeslight / AppDelegate.m
Last active August 29, 2015 14:02
UIAlertView and UIWindow in AppDelegat.m succession
//
// ViewController.m
// TestAlert
//
// Created by akira on 6/10/14.
// Copyright (c) 2014 akira. All rights reserved.
//
#import "ViewController.h"
@threetreeslight
threetreeslight / deamon.rb
Created August 21, 2014 08:16
deamon DSL
require 'logger'
require 'rails'
require 'net/http'
require 'uri'
require 'pry'
class Daemon
def self.run &block
new &block
end
@threetreeslight
threetreeslight / ec2-ssh.sh
Last active August 29, 2015 14:06
ec2-ip, ec2-ssh
# ec2-ip
function ec2-ip() {
if [[ $1 == "" ]]; then
PERCOL=percol
else
PERCOL="percol --query $1"
fi
instances | eval $PERCOL | awk '{ print $1 }'
}
#import "UIViewController+RPRIS.h"
#import <objc/runtime.h>
@implementation UIViewController (Foo)
+ (void)swizzlingMethodViewWillApper
{
Method originalMethod = class_getInstanceMethod(self, viewWillApper:);
Method swizzledMethod = class_getInstanceMethod(self, foo_viewWillApper:);
method_exchangeImplementations(originalMethod, swizzledMethod);