Skip to content

Instantly share code, notes, and snippets.

View geta6's full-sized avatar

geta6 geta6

View GitHub Profile
@geta6
geta6 / HandBrakePreset
Created May 22, 2011 14:43
no-deinterlace and decomb and low deblock
HandBrakeCLI \
-i K_ON-1-01.mp4 -o K_ON-1-01_2.mp4 \
-a 3 -E faac -B 128 -6 dpl2 -R Auto \
-e x264 -r 24 -X 1280 --denoise="weak" -5 -O -m \
-x level=30:cabac=0:ref=5:vbv-maxrate=1500:vbv-bufsize=2000:\
analyse=all:me=umh:no-fast-pskip=1:mixed-refs=1:deblock=-2,-2:\
no-dct-decimate=1:cqm=flat:aq-strength=0:psy-rd=0,0
@geta6
geta6 / zshenv
Created October 11, 2011 07:31
nvm loader
if [ ! -e $HOME/.nvm ]; then
:
else
. ~/.nvm/nvm.sh
fi
@geta6
geta6 / clip.zsh
Created October 11, 2011 09:01
Clip StdOut function for MacOSX
# コマンドをevalしてクリップボードに送るだけ
# Ex.) clip cat ~/.ssh/id_rsa.pub
function clip() {
local str
  if [ $# != 0 ]; then
for i in $*; do
str="$str $i"
done
fi
@geta6
geta6 / zshrc.zsh
Created October 19, 2011 00:48
screen x zsh
preexec () {
if [ ${WINDOW} ]; then
echo -ne "\ek${1%% *}\e\\"
fi
}
if [ ! ${WINDOW} ]; then
cd $HOME/Library/Rcfiles/; git pull &; cd
case "${HOST}" in
GtxAir* )
@geta6
geta6 / tellme.zsh
Created October 19, 2011 01:44
Notify command done with Growl.
#
# Ex. tellme make install
#
function tellme() {
if [ `which growlnotify` ]; then
local str
if [ $# != 0 ]; then
for i in $*; do
str="$str $i"
done
@geta6
geta6 / re-linker.sh
Created October 20, 2011 11:14
a2mod_securedownload
cd hoge
wget "http://mod-auth-token.googlecode.com/files/mod_auth_token-1.0.5.tar.gz"
tar zxvf mod_auth_token-1.0.5.tar.gz
cd mod_auth_token-1.0.5
rm missing config.guess config.sub COPYING install-sh
ln -s /usr/share/automake-1.11/missing
ln -s /usr/share/automake-1.11/config.guess
ln -s /usr/share/automake-1.11/config.sub
ln -s /usr/share/automake-1.11/COPYING
ln -s /usr/share/automake-1.11/install-sh
@geta6
geta6 / tokenizer.php
Created October 20, 2011 11:25
for mod_auth_token
<?php
$key = 'token'; // Secret
$dirpath = '/token/'; //Prefix
$filepath = '/sample/file.mp3'; // relative path from ScriptAlias
$tokenize_url = auth_token($key, $dirpath, $filepath);
function auth_token($key,$dirpath,$filepath){
$hex = dechex(time());
@geta6
geta6 / install_shairport.sh
Created October 20, 2011 11:35
Install ShairPort
cd /usr/local/src
git clone https://github.com/albertz/shairport
cd shairport
export ARCHFLAGS="-arch x86_64"
brew install pkg-config libao
make
perl -MCPAN -e 'install Crypt::OpenSSL::RSA'
perl -MCPAN -e 'install IO::Socket::INET6'
vi shairport.pl
# 65 -- my $hairtunes_cli = $FindBin::Bin . '/hairtunes';
@geta6
geta6 / Gun.js
Created October 21, 2011 09:18
Input.GetButton Method
var bulletPrefab : GameObject;
var initialVelocity : float;
function Update () {
if (Input.GetButton("Fire1")) {
var screenPoint = Input.mousePosition;
screenPoint.z = 10.0;
Instantiate(bulletPrefab, transform.position, transform.rotation).rigidbody.velocity
= ((camera.ScreenToWorldPoint(screenPoint)) - transform.position).normalized * initialVelocity;
}
@geta6
geta6 / BoxGenerate.js
Created October 21, 2011 09:20
Generate Object
var interval : float;
var redBoxPrefav : GameObject;
var blueBoxPrefav : GameObject;
private var isRed : boolean;
private var nextTime : float;
function Start () {
isRed = true;
nextTime = 0.0;