Skip to content

Instantly share code, notes, and snippets.

module IdeaCard
module ModuleMethods
functions = %w(goal point change)
current_file_path = File.dirname(__FILE__)
functions.each do |m|
eval <<-EOC
def #{m}
path = File.expand_path "./#{m}s", "#{current_file_path}"
@#{m}s ||= load(path)
@#{m}s.sample
#import "NSObject+PerformBlock.h"
@implementation NSObject (PerformBlock)
- (void)performBlock:(void (^)())block
{
block();
}
- (void)performBlock:(void (^)())block afterDelay:(NSTimeInterval)delay
#import <Foundation/Foundation.h>
@interface NSObject (PerformBlock)
- (void)performBlock:(void (^)())block afterDelay:(NSTimeInterval)delay;
@end
Pod::Spec.new do |s|
s.name = "MNMBottomPullToRefresh"
s.version = "0.0.1"
s.summary = "."
s.description = <<-DESC
MNMBottomPullToRefresh is a solution to add pull-to-refresh feature to the bottom of an UITableView instead of the top, as usual.
DESC
s.homepage = "https://github.com/emenegro/bottom-pull-to-refresh"
s.platform = :ios, '5.0'
s.author = 'Mario Negro'
# script for incrementing short version string for Xcode.
InfoPlist="${SRCROOT}/${INFOPLIST_FILE}"
buildNumber=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $InfoPlist`
buildNumber=`echo $buildNumber + 1.0 | bc`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" $InfoPlist
vvv=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $InfoPlist`
mm=`echo $vvv | cut -d . -f 1,2`
last=`echo $vvv | cut -d . -f 3`
@pi-chan
pi-chan / mediawiki_to_markdown.rb
Created March 5, 2014 07:19
MediaWikiからエクスポートした記事をまあまあの感じでMarkdownにコンバートする
require "Nokogiri"
xml = File.open("./data.xml").read
doc = Nokogiri.XML(xml)
def convert_to_markdown(mw)
mw.gsub!(/^# /, '1. ')
mw.gsub!(/^\* /, '- ')
mw.gsub!(/^====(.+)====$/, '#### \1')
mw.gsub!(/^===(.+)===$/, '### \1')
@pi-chan
pi-chan / ipa.sh
Last active January 20, 2016 04:56
#!/bin/sh
SDK="iphoneos"
CONFIGURATION="Release"
PROJECT_FILE="SampleApp.xcodeproj"
TARGET_NAME="SampleApp"
SCHEME_NAME="SampleApp"
PRODUCT_NAME="SampleApp"
IPA_FILE_NAME="SampleApp"
OUT_APP_DIR="out"
@pi-chan
pi-chan / tags_default
Created March 26, 2014 23:57
ctags default
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
SVProgressHUDMaskType SVProgressHUD/SVProgressHUD.h /^typedef NSUInteger SVProgressHUDMaskType;$/;" t
SVProgressHUDMaskTypeBlack SVProgressHUD/SVProgressHUD.h /^ SVProgressHUDMaskTypeBlack, \/\/ don't allow and dim the UI in the back of the HUD$/;" e enum:__anon1
SVProgressHUDMaskTypeClear SVProgressHUD/SVProgressHUD.h /^ SVProgressHUDMaskTypeClear, \/\/ don't allow$/;" e enum:__anon1
SVProgressHUDMaskTypeGradient SVProgressHUD/SVProgressHUD.h /^ SVProgressHUDMaskTypeGradient \/\/ don't allow and dim the UI with a a-la-alert-view bg gradient$/;" e enum:__anon1
@pi-chan
pi-chan / tags_objc
Created March 26, 2014 23:58
ctags with objc settings
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
AppDelegate Demo/Classes/AppDelegate.m /^@implementation AppDelegate$/;" c
SVProgressHUD SVProgressHUD/SVProgressHUD.m /^@implementation SVProgressHUD$/;" c
ViewController Demo/Classes/ViewController.m /^@implementation ViewController$/;" c
activityCount SVProgressHUD/SVProgressHUD.m /^@property (nonatomic, readwrite) NSUInteger activityCount;$/;" p
@pi-chan
pi-chan / evernote-mandalart.scpt
Last active August 29, 2015 13:57
EvernoteでマンダラートするスクリプトEvernote5対応版 http://memogakisouko.appspot.com/Evernote.html
(*
このスクリプトの改造、再配布OK
*)
property theNoteBookName : "209.マンダラート" -- 保存するノートブック名
property htmlTemplate : "<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title><<title>></title>