Skip to content

Instantly share code, notes, and snippets.

View skahack's full-sized avatar
🐳
...

Hiroki Sato skahack

🐳
...
View GitHub Profile
@skahack
skahack / goo_lyric.rb
Created July 1, 2011 13:15
goo歌詞、コピーできなくなってる!!!
# encoding: UTF-8
require 'rubygems'
require 'uri'
require 'open-uri'
require 'json'
require 'nokogiri'
require 'appscript'
HTTP = 'http://'
@skahack
skahack / gist:1097004
Created July 21, 2011 11:35
iTunes 現在再生中の曲名
# encoding:UTF-8
require 'rubygems'
require 'appscript'
itunes = Appscript.app('iTunes')
p itunes.current_track.name.get()
@skahack
skahack / nsFileVersionTest.m
Created July 28, 2011 05:55
NSFileVersionTest.m
// clang -o nsFileVersionTest nsFileVersionTest.m -lobjc -framework Cococa
#import <Cocoa/Cocoa.h>
void applicationMain()
{
NSURL *url = [NSURL fileURLWithPath:@"/Users/SKAhack/Desktop/Test.txt" isDirectory:NO];
NSArray *versions = [NSFileVersion otherVersionsOfItemAtURL:url];
for (NSFileVersion *f in versions) {
diff --git a/colors/rdark-terminal.vim b/colors/rdark-terminal.vim
index c16e19e..5c6cf8a 100644
--- a/colors/rdark-terminal.vim
+++ b/colors/rdark-terminal.vim
@@ -27,7 +27,7 @@ let colors_name="rdark-terminal"
hi clear CursorLine
hi CursorLine ctermbg=8
-hi Normal term=NONE cterm=NONE ctermbg=0 ctermfg=252
+hi Normal term=NONE cterm=NONE ctermbg=235 ctermfg=252
@skahack
skahack / rdark.dvtcolortheme
Created August 14, 2011 03:56
rdark Xcode Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@skahack
skahack / gist:1153902
Created August 18, 2011 11:38
3本指タップ実装してないと出るエラー
2011-08-18 20:17:44.405 ****[1913:707] Lookup: Unhandled exception 'NSRangeException' caught in __56+[LULookupDefinitionModule focusTermUsingQueue:handler:]_block_invoke_0
@skahack
skahack / gist:1153914
Created August 18, 2011 11:44
NSViewの座標系変換
// self = NSView
//NSRect rect;
// 画面左下が起点の座標系に変換
rect = [self convertRectToBase:rect];
// スクリーン座標系に変換
rect.origin = [[self window] convertBaseToScreen:rect.origin];
javascript:(function(){var s='';for(var i in es){if(!isNaN(i)&&es[i][1]==='1')s=s+es[i][5]+" : "+es[i][14]+"\n";}alert(s)})()
@skahack
skahack / gist:1207826
Created September 10, 2011 02:02
Haskell like
clone = (n) ->
if Array.isArray(n)
re = [].concat n
else
re = Object.extended({})
for key in n
re[key] = n[key]
re
foldr = (f) -> (x) -> (y) ->
@skahack
skahack / gist:1210913
Created September 12, 2011 09:25
Named Fields
module Main where
data Option =
Option
{ option1 :: String
, option2 :: Maybe String
, option3 :: Maybe String
} deriving (Show)