This file contains 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 <mach-o/dyld.h> | |
#include <mach-o/getsect.h> | |
#include <dlfcn.h> | |
#include <string> | |
std::string GetModuleFileName(const void *module) | |
{ | |
if (!module) { return std::string(); } | |
uint32_t count = _dyld_image_count(); | |
for (uint32_t i = 0; i < count; ++i) { |
This file contains 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 ruby | |
require 'tempfile' | |
require 'fileutils' | |
def usage | |
print "usage: xcode-textencoding [project-file] [text-encoding-name]\n" | |
print " project-file a file path of Xcode project (ex. some.xcodeproj)\n" | |
print " text-encoding-name screen name of text encoding\n" | |
end |
This file contains 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 "convert_text_encoding.hpp" | |
#include <CoreServices/CoreServices.h> | |
#include <memory> | |
namespace detail | |
{ | |
//! | |
//! @brief Get string encoding of wstring. | |
CFStringEncoding get_wide_string_encoding(); |
This file contains 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
' About: | |
' A git-daemon starter script for Windows. | |
' | |
' Workflow: | |
' 1. C:\>mkdir GitRepositories | |
' 2. C:\>cd GitRepositories | |
' 3. C:\GitRepositories>mkdir sample.git | |
' 4. C:\GitRepositories>cd sample.git | |
' 5. C:\GitRepositories\sample.git>"C:\Program Files\Git\bin\git.exe" init --bare | |
' 6. Edit this script to change 'git' and 'repository_base_path' |
This file contains 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
set PREFIX="C:\Boost" | |
set MAX_JOB=4 | |
call bootstrap.bat | |
b2.exe install link=static,shared --prefix=%PREFIX% -j %MAX_JOB% | |
b2.exe install link=static runtime-link=static --prefix=%PREFIX% -j %MAX_JOB% | |
call bootstrap.bat gcc | |
b2.exe install link=static,shared --prefix=%PREFIX% -j %MAX_JOB% toolset=gcc | |
b2.exe install link=static runtime-link=static --prefix=%PREFIX% -j %MAX_JOB% toolset=gcc |
This file contains 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/bash | |
function build_httpd_rpm { ( | |
local base_version=$1 | |
local buildroot=$(rpmbuild --eval=%_topdir 2>/dev/null | tr -d '\n') | |
mkdir -p $buildroot | |
local major_version=$(echo $base_version | cut -f1 -d'.') | |
local minor_version=$(echo $base_version | cut -f2 -d'.') | |
local release_version=$( |
This file contains 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
// ==UserScript== | |
// @name Google Header | |
// @namespace http://kbinani.info/ | |
// @description | |
// @include https://mail.google.com/* | |
// @include https://www.google.com/reader/* | |
// ==/UserScript== | |
(function() { | |
setInterval(function() { |
This file contains 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/bash | |
function svn_export { | |
function svn_export_one { ( | |
local url=$1 | |
local directory=$2 | |
local revision=$3 | |
local prefix="$(echo $url | cut -b $(expr ${#base_url} + 2)-)" | |
for file in $(curl -L "$url?p=$revision" 2>/dev/null | grep '<li><a href=".*"' | sed 's:^.*<li><a href=".*">\(.*\)</a>.*$:\1:g'); do | |
if [ "$file" = "$(echo $file | sed 's:^.*\(/\)$:\1:g')" -a "$file" != ".." ]; then |
This file contains 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
while :; do if git svn fetch; then break; else sleep 60; fi done |
This file contains 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
alias svndiff='svn diff --diff-cmd=colordiff --extensions=" -u --strip-trailing-cr --ignore-space-change " | less --quit-if-one-screen' |