Skip to content

Instantly share code, notes, and snippets.

@r-plus
r-plus / gdb
Created February 8, 2012 14:29
2012/2/8 AppStore.app gdb debuged Classes and Selectors
##Desc
2012/2/8 AppStore.app gdb debuged Classes and Selectors
##Class
Classes matching "*":
ABAnyValuePredicate ABCCallbackInvoker
ABGroupMembershipPredicate ABHelper
ABNamePredicate ABPersonLinker
@r-plus
r-plus / pyfes.py
Created March 17, 2012 05:45
json practice.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import datetime
userTimeline = urllib2.urlopen('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=%s&count=3' % 'search_account')
contents = json.loads(userTimeline.read())
@r-plus
r-plus / ModifyTableStyle.bas
Created April 28, 2012 03:05
modify the table style in MS-Word.
Sub ModifyTableStyle()
On Error Resume Next
For Each i In ActiveDocument.Tables()
' Stroke around table at bold single line.
With i.Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
.Color = Options.DefaultBorderColor
End With
" A ref source for alc.
" Version: 0.2.1
" Author : soh335 <sugarbabe335@gmail.com>
" : thinca <thinca+vim@gmail.com>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
let s:save_cpo = &cpo
set cpo&vim
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <objc/runtime.h>
#import <UIKit/UIKit.h>
@class UIKeyboardLayoutStar;
static BOOL replaced_UIKeyboardLayoutStar_shouldShowDictationKey(UIKeyboardLayoutStar *self, SEL _cmd) {
return NO;
}
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <objc/runtime.h>
#import <UIKit/UIKit.h>
#import <substrate.h>
@class UIKeyboardLayoutStar;
static BOOL replaced_UIKeyboardLayoutStar_shouldShowDictationKey(UIKeyboardLayoutStar *self, SEL _cmd) {
// can be able to call original method.
@r-plus
r-plus / install_theos.sh
Created October 27, 2012 01:00 — forked from tom-go/install_theos.sh
Theos install script
#!/bin/bash
THEOS_INSTALL_DIR="/opt"
THEOS=${THEOS_INSTALL_DIR}/theos
BIGBOSS_REPO="http://apt.thebigboss.org/repofiles/cydia"
SUBSTRATE_REPO="http://apt.saurik.com"
# initial theos install directory check
if [ ! -d "$THEOS_INSTALL_DIR" ]; then
echo "making $THEOS_INSTALL_DIR"
@r-plus
r-plus / InstaBanner.h
Created November 14, 2012 14:27
libinstabanner header file
@interface InstaBanner : NSObject
// Must necessary argument: bundleidentifier
// If title is nil, automatically set to displayName of bundleidentifier.
+ (void)showBannerWithBundleIdentifier:(NSString *)bundleidentifier title:(NSString *)title message:(NSString *)message;
@end
// Usage
// [InstaBanner showBannerWithBundleIdentifier:[NSBundle mainBundle].bundleIdentifier title:nil message:@"test"];
@r-plus
r-plus / firstLastKey.py
Created November 23, 2012 03:29
get first and last key from dictionary instance.
import datetime
day23 = datetime.datetime(2012, 10, 23)
day24 = datetime.datetime(2012, 10, 24)
# dictionary does not have order.
dict = {day24 : 24, day23 : 23}
# get first key
sorted(dict.keys())[0]
# get last key
<?php
require_once 'classTextile.php';
if ( isset($_SERVER['PATH_TRANSLATED']) ) {
$file = realpath($_SERVER['PATH_TRANSLATED']);
$ext = substr($file, strrpos($file, '.') + 1);
}
if ( $file and is_readable($file) and $ext === 'textile') {
$textile = new Textile();