Skip to content

Instantly share code, notes, and snippets.

@Sakurina
Sakurina / fairchild.cy
Created May 9, 2010 19:04
CaptainHook-inspired syntax sugar for hooking stuff with Cycript
/*
* fairchild - an enhanced syntax for hooking stuff with Cycript
* by Yanik Magnan - http://r-ch.net
*/
var FCSuper = {};
var FCClassSuper = {};
function FCMethod(_className, _selector, _block) {
if (!FCSuper[_className])
@Sakurina
Sakurina / selache.rb
Created July 4, 2010 04:27
shreds redundant selector declarations (cycript optimization)
#!/usr/bin/env ruby
# selache - by Yanik Magnan (r-ch.net)
# make selectors only appear in your cycript code ONCE
input_code = STDIN.read
selectors = input_code.scan(Regexp.new('(new)( )(Selector)(\\()(".*?")(\\))', Regexp::IGNORECASE)).uniq
sel_counter = 0;
selectors.each { |sel|
method_name = sel[4].gsub("\"","")
@teramako
teramako / htmlParser.js
Created November 1, 2010 13:22
iframeにテキストを読み込ませてHTMLパースを行う
/**
* HTML テキストをパースするサンプル
* @see http://mxr.mozilla.org/mozilla/source/browser/components/microsummaries/src/nsMicrosummaryService.js
*
* スクリプトや画像を読み込まず、パースのみをするはず。
* 当然ながら XPCOM の使用特権(Chrome特権)が必要
*/
/*
// Sample 1
httpGet("http://example.com",
diff --git a/common.mk b/common.mk
index 3582c70..da3ae6d 100644
--- a/common.mk
+++ b/common.mk
@@ -126,9 +126,9 @@ BOOTSTRAPRUBY = $(BASERUBY)
COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
-all: main docs
+all: main
@Sakurina
Sakurina / ICQuery.cy
Created December 28, 2010 04:59
ICQuery - helpers for working with icon lists from cycript
/*
* ICQuery - helpers for working with icon lists from cycript
* by Yanik Magnan - http://r-ch.net
*
* EXAMPLES:
* i$(0) => dictionary containing the 0th icon list model and view
* i$(ilModel) => index of that icon list model in the root folder
* i$(ilView) => index of that icon list view in the root folder
*
* WHAT ABOUT NON-ROOT FOLDERS?
@rummelonp
rummelonp / tw_to_tmbr.rb
Created April 10, 2011 16:20
TwitterのRSSからTumblrにQuoteを投稿するRubyスクリプト
# -*- coding: utf-8 -*-
## tw_to_tmbr is the script that to post quote to tumblr from twitter rss feed.
##
## requirements:
## tumblr (gem install tumblr-rb)
##
require 'rubygems'
require 'tumblr'
require 'open-uri'
@rizumita
rizumita / MBProgressHUD with Blocks.m
Created May 20, 2011 03:38
MBProgressHUD with Blocks
#if NS_BLOCKS_AVAILABLE
- (void)showWhileExecutingBlock:(void (^)())block animated:(BOOL)animated {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
block();
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self cleanUp];
});
});
@motemen
motemen / himecab.pl
Created June 27, 2011 10:48
highlight text by mecab segmentation
use strict;
use warnings;
use opts;
use Text::MeCab;
use Encode;
use Encode::Locale;
use Term::ANSIColor;
my @COLORS = qw(
yellow red blue green cyan magenta
@pokstad
pokstad / JsonPlistConverter.py
Created September 5, 2011 19:23
Convert between JSON and Plist Files
#!/usr/bin/env python
import plistlib
import json
import tkFileDialog
import re
import sys
file_to_open = tkFileDialog.askopenfilename(message="Select an existing plist or json file to convert.")
converted = None
@matsuda
matsuda / gist:1350246
Created November 9, 2011 03:29
EXC_BAD_ACCESSの対処法
#
# 毎回忘れるのでメモ
# http://ameblo.jp/tokotokosoftware/entry-10791578218.html
# http://iphone.longearth.net/2009/03/09/【iphone】メモリ不足時のシミュレートとデバッグ/
# http://d.hatena.ne.jp/Kazzz/20120109/p1
# XCode4:「Product -> Edit Scheme」の「Arguments」タブの「Environment Variables」に追加
#
NSDebugEnabled = YES
NSZombieEnabled = YES