Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# increment package version
# example: incpv com.directoryname_0.1-1
# com.directoryname_0.1-1/ -> com.directoryname_0.1-2/
# Version: 0.1-1 -> Version: 0.1-2
if [ $# -ne 1 ]; then
echo "ERROR: Wrong number of arguments."
exit 1
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Wrong number of arguments"
exit 1
fi
if [ -d $1 ]; then
dpkg-deb -b ${1%/}
fi
BusyBox v1.10.4 (2009-09-27 21:54:08 CST) multi-call binary
Copyright (C) 1998-2007 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
#import "PasteboardStackerNotifier.h"
@implementation PasteboardStackerNotifier
- (id) init {
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(uiPasteboardDidChange:)
name:@"UIPasteboardChangedNotification"
object:nil];
}
@moyashi
moyashi / gist:632308
Created October 18, 2010 14:37
indent-region
(global-set-key [f5] 'indent-region)
(global-set-key [f6]
'(lambda ()
(interactive)
(indent-region (point-min) (point-max))))
//
// ReederMacPatcherShareTwitter.m
// ReederMacPatcher
//
// Created by moyashi on 11/01/16.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "ReederMacPatcherShareTwitter.h"
@moyashi
moyashi / gist:816582
Created February 8, 2011 15:30
TypeIt4MeのAppleScript実行機能でAppleScriptを評価してペーストするサンプル
-- http://twitpic.com/3xq8rf
-- Rubyを呼び出しているサンプルです
-- 「システム環境設定>ユニバーサルアクセス>補助装置にアクセスできるようにする」をONにしていないと動かないです
on paste(s)
set old to the clipboard
set the clipboard to (s as unicode text)
tell application "System Events"
key down command
@moyashi
moyashi / gist:847215
Created February 28, 2011 11:47
SafariのHeaderでopenurlをgrep
-*- mode: grep; default-directory: "~/Dropbox/Mac/SIMBL/SafariHeaders/" -*-
Grep started at Mon Feb 28 20:39:02
grep -nH -i openurl *
AppController.h:58:- (void)openURL:(id)arg1 forcingHTMLMIMEType:(BOOL)arg2;
BrowserContentWebView-BrowserContextMenu.h:27:- (void)openURLInNewTab:(id)arg1 tabLocation:(id)arg2;
BrowserContentWebView-BrowserContextMenu.h:28:- (void)openURLInNewWindow:(id)arg1;
BrowserWebView-FileInternal.h:42:- (BOOL)_openURLExternallyWithRequest:(id)arg1 inFrame:(id)arg2 displayError:(BOOL)arg3;
NSWorkspace-BrowserNSWorkspaceExtras.h:12:- (BOOL)openURL:(id)arg1 withApplicationAtPath:(id)arg2;
NSWorkspace-BrowserNSWorkspaceExtras.h:15:- (BOOL)openURL:(id)arg1 withApplicationWithBundleIdentifier:(id)arg2;
@moyashi
moyashi / gist:847513
Created February 28, 2011 15:58
Safariで表示中のWebViewにJavaScriptを実行させる
[[[[BrowserDocumentController sharedDocumentController] frontmostBrowserDocument] currentBrowserWebView] stringByEvaluatingJavaScriptFromString:@"alert(1)"];
@moyashi
moyashi / gist:850720
Created March 2, 2011 10:01
ゴミの日を返すDateTime::kind_of_separated_refuse
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
# kind of separated refuse
# written by moyashi
# 2011.03.02
require 'date'
# grabbed from http://rubyist.g.hatena.ne.jp/yamaz/20070125
class Object