Skip to content

Instantly share code, notes, and snippets.

@abcang
abcang / vita-toolchain.patch
Created June 17, 2015 01:55
vita-toolchain patch for Mac
diff --git endian-utils.h endian-utils.h
index 65bafe6..4d7a1f8 100644
--- endian-utils.h
+++ endian-utils.h
@@ -1,7 +1,7 @@
#ifndef ENDIAN_UTILS_H
#define ENDIAN_UTILS_H
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(__APPLE__)
@abcang
abcang / arm-none-eabi
Created June 22, 2015 03:37
arm-none-eabi
$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/devkitpro/devkitARM/libexec/gcc/arm-none-eabi/4.9.2/lto-wrapper
Target: arm-none-eabi
Configured with: ../../gcc-4.9.2/configure --enable-languages=c,c++,objc,obj-c++ --with-gnu-as --with-gnu-ld --with-gcc --with-march=armv4t --enable-poison-system-directories --enable-interwork --enable-multilib --disable-dependency-tracking --disable-threads --disable-win32-registry --disable-nls --disable-debug --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --target=arm-none-eabi --with-newlib --with-headers=../../newlib-2.1.0/newlib/libc/include --prefix=/opt/devkitpro/devkitARM --enable-lto --with-bugurl=http://wiki.devkitpro.org/index.php/Bug_Reports --with-pkgversion='devkitARM release 43'
Thread model: single
gcc version 4.9.2 (devkitARM release 43)
$ arm-none-eabi-ld -v
@abcang
abcang / bitbucket_hide_approved_pull_requests_mod.user.js
Created September 24, 2015 09:27
bitbucket_hide_approved_pull_requests_mod.user.js
// ==UserScript==
// @name bitbucket_hide_approved_pull_requests mod
// @namespace http://abcang.net
// @version 0.2
// @description Bitbucket_hide_approved_pull_requests
// @author ABCanG
// @match https://bitbucket.org/*/*/pull-requests*
// @grant none
// ==/UserScript==
@abcang
abcang / remote-make.sh
Last active December 15, 2015 15:51
リモートにデータをコピーしてmakeし、手元に転送するコマンド
#!/bin/bash
DIR="$(basename "$(pwd)")"/
HOST="$1"
OPT="$(cut -d " " -f2- <<<""$@" ")"
DIST=/tmp/"$DIR"/
cd ..
rsync -rtuvz --delete "$DIR" "$HOST":"$DIST"
ssh "$HOST" "cd $DIST; make $OPT"
@abcang
abcang / cryptooo.rb
Created December 6, 2015 08:55
cryptooo
key = "SECCON{Cry_Pto_Oo_Oo1Oo_"
ans = "waUqjjDGnYxVyvUOLN8HquEO0J5Dqkh/zr/3KXJCEnw="
o = [('a'..'z'), ('A'..'Z'), ('0'..'9'), ['-', '_']].map { |i| i.to_a }.flatten
c = 0
index = []
max = o.length ** 3
while true
index[2] = c % o.length
index[1] = (c / o.length) % o.length
@abcang
abcang / error-filter.rb
Last active November 29, 2016 18:01
いい感じにlatexのログからエラーを抽出するやつ
# coding: utf-8
log_file = ARGV.shift
File.open(log_file) do |file|
tex_file = ""
error_msg = []
error_flag = false
file.each_line do |line|
line = line.chomp
@abcang
abcang / install_peco.sh
Last active April 9, 2016 10:35
pecoの最新版インストール
#!/bin/sh
bit=""
if [ $(uname -m) = "x86_64" ]; then
bit="amd64"
elif [ $(uname -m) = "i686" ]; then
bit="386"
fi
version=$(curl -sI https://github.com/peco/peco/releases/latest | awk -F'/' '/^Location:/{print $NF}' | tr -d '\r\n')
url=https://github.com/peco/peco/releases/download/$version/peco_linux_$bit.tar.gz
@abcang
abcang / .zshrc
Created April 9, 2016 10:33
ssh先の場合tmux自動起動するやつ。.zshrcとかに入れると便利。tmuxをデタッチするとssh終了するか聞かれるので便利
## ssh先の場合tmux自動起動
if [[ -n "${REMOTEHOST}${SSH_CONNECTION}" && -z "$TMUX" && -z "$STY" ]] && type tmux >/dev/null 2>&1; then
function confirm {
MSG=$1
while :
do
echo -n "${MSG} [Y/N]: "
read ans
case $ans in
[yY]) return 0 ;;
@abcang
abcang / nicomoveframe.user.js
Created June 25, 2016 09:09
ニコニコの動画を矢印キーで数秒進めたり戻したりできるやつ
// ==UserScript==
// @name Niconico move frame
// @namespace https://abcang.net/
// @version 0.1
// @description move frame on niconico video to press arrow key
// @author ABCanG
// @match http://www.nicovideo.jp/watch/*
// @grant none
// ==/UserScript==
@abcang
abcang / meiro.txt
Created September 11, 2016 06:15
適当に作った迷路
14 14
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 0 0 1 3 0 1 1 1 1 1 0 1
1 0 0 1 0 1 0 0 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 0 0 0 1 0 1 0 1 0 1 0 1
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1
1 1 1 1 1 0 0 0 0 1 0 1 0 1 1
1 0 0 0 0 0 0 1 1 1 0 0 0 1 1
1 1 1 1 0 1 0 0 1 1 1 0 0 1 1