This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; anything-mac-itunes.el --- Use iTunes on Mac with anything.el | |
;; Copyright (C) 2010 Hiroshige Umino | |
;; Author: Hiroshige Umino <[email protected]> | |
;; Created: 2010-11-24 | |
;; Version: 0.0.1 | |
;; | |
;; Keywords: anything, mac | |
;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "iTunes" | |
set allSongs to (every file track of playlist "Library") | |
set idx to random number from 0 to (count of allSongs) - 1 | |
set aSong to item idx of allSongs | |
play aSong | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# append the line "BRANCHNAME: " to the top of commit msg | |
if [ "$2$3" = "" ]; then | |
branch=$(git symbolic-ref HEAD 2>/dev/null) | |
branch=${branch##refs/heads/} | |
echo "$branch: \n`cat $1`" > "$1" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- nanotap.h 2010-11-18 23:51:59.000000000 +0900 | |
+++ nanotap+color.h 2010-11-18 23:54:57.000000000 +0900 | |
@@ -18,6 +18,7 @@ | |
#endif | |
static int TEST_COUNT = 0; | |
+static int FAIL_COUNT = 0; | |
/** | |
* This simply evaluates any expression ("$got eq $expected" is just a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DEBUG_H | |
#define DEBUG_H | |
#if DEBUG | |
#define ILOG(...) fprintf(stderr, "\e[32m[I]\e[0m " __VA_ARGS__) | |
#define DLOG(...) fprintf(stderr, "\e[33m[D]\e[0m " __VA_ARGS__) | |
#define ELOG(...) fprintf(stderr, "\e[31m[E]\e[0m " __VA_ARGS__) | |
#define LINE fprintf(stderr, "\e[31m------------------------------\e[0m") | |
#else | |
#define ILOG(...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Search moduels using minicpan data | |
# $ minicpan-search plack middleware | |
# $ minicpan-search authorname | |
# $ minicpan-search --root=~/myminicpandir authorname | |
# $ cpanm `minicpan-search --colon-format module` | |
use strict; | |
use warnings; | |
use Cwd 'abs_path'; | |
use File::Basename; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!setting to make Hennkann/Muhennkann keys to be ctrl keys | |
clear mod3 | |
keycode 100 = Control_R | |
add control = Control_R | |
keycode 102 = Control_L | |
add control = Control_L |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#include <gflags/gflags.h> | |
#include <glog/logging.h> | |
#define LINE std::cout << "------------------------------------------------------------" << std::endl; | |
// $ ./logging_sample -logtostderr=1 | |
int main(int argc, char* argv[]) { | |
// Initialize Google's logging library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rooturl="http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/" | |
zipfile="chrome-mac.zip" | |
cd ~/tmp | |
rm -rf chrome-mac* | |
wget $rooturl`curl ${rooturl}LATEST`"/"$zipfile | |
unzip $zipfile | |
cd ./chrome-mac | |
cp -R ./Chromium.app /Applications/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun insert-str-with-line-context (regexp inserting-str default-char) | |
(let ((ptr (point))) | |
(beginning-of-line) | |
(let ((str (buffer-substring (point) ptr))) | |
(goto-char ptr) | |
(if (string-match regexp str) | |
(insert inserting-str) | |
(insert default-char))))) | |
;; typing "4" inserts "$", not "4" if you wrote "my " or "my (" |