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
# git clone https://github.com/ngyuki/checkinstall.git | |
# cd checkinstall | |
# make | |
# sudo make install | |
# GCC_VERSION=4.9.2 | |
# wget http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz || { echo "Failed downloading tarball" && exit 1; } | |
# tar zxf gcc-$GCC_VERSION.tar.gz | |
# cd gcc-$GCC_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
0 0 * * * API_TOKEN="xxxx"; HOUR_FROM=11; HOUR_TO=22; function get_rand { local FROM=$1; local TO=$2; local DIFF=$(echo "$TO - $FROM" | bc); echo "$FROM + $DIFF * $(echo "ibase=16; $(openssl rand -hex 2 | tr a-f A-F)" | bc) / 65535" | bc; }; echo "sleep $(get_rand 0 59) >/dev/null 2>&1; curl -d token=$API_TOKEN http://haka.yamashi.ro/api/v1/incenses >/dev/null 2>&1" | at $(printf "\%02d:\%02d" $(get_rand $HOUR_FROM $HOUR_TO) $(get_rand 0 59)) >/dev/null 2>&1 |
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
mkdir hoge | |
touch hoge/hoge.txt | |
hdiutil makehybrid -udf -o hoge.iso hoge |
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 <fstream> | |
inline std::string file_get_contents(std::string const& path) | |
{ | |
return (std::stringstream() << std::ifstream(path).rdbuf()).str(); | |
} |
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 <execinfo.h> | |
void * trace[128]; | |
int const num_trace = backtrace(trace, 128); | |
char ** trace_symbols = backtrace_symbols(trace, num_trace); | |
for (int i = 0; i < num_trace; ++i) { | |
std::cout << trace_symbols[i] << std::endl; | |
} | |
free(trace_symbols); |
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
npm install -g ffi --python=C:\Python27\python.exe --msvs_version=2012 |
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
#import <Cocoa/Cocoa.h> | |
#include <wx/wx.h> | |
#include <wx/caret.h> | |
#include <wx/glcanvas.h> | |
#include <wx/rawbmp.h> | |
#include <sstream> | |
#include <boost/chrono.hpp> | |
#include <boost/optional.hpp> | |
#include <vector> |
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 'optparse' | |
def create_symbol_list(binary_path, arch) | |
temp = `mktemp -t tmp` | |
`nm -arch #{arch} "#{binary_path}" 2>/dev/null \ | |
| awk '$3 != "" { print $0 }' \ | |
| sort \ | |
> "#{temp}"` |
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 get_package_id { ( | |
readonly PKG_INFO=PackageInfo | |
local PKG=$(cd "$(dirname "$1")"; pwd)/$(basename "$1") | |
local EXCLUDES= | |
for FILE in $(xar -t -f "$PKG" | grep -v $PKG_INFO); do | |
EXCLUDES="$EXCLUDES --exclude $FILE" | |
done | |
local TEMP=$(mktemp -t hoge | tr -d '\r') |
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
function get_cursor_hotspot_x { ( | |
local FILE_PATH=$1 | |
od -N 2 -j 10 -t u "$FILE_PATH" | awk '{print $2}' | head -1 | |
) } | |
function get_cursor_hotspot_y { ( | |
local FILE_PATH=$1 | |
od -N 2 -j 12 -t u "$FILE_PATH" | awk '{print $2}' | head -1 | |
) } |