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
var smokePrefab : GameObject; | |
function OnCollisionEnter(collisionInfo : Collision) { | |
if (collisionInfo.gameObject.tag == "Box") { | |
collisionInfo.gameObject.SendMessage("ApplyDamage"); | |
} | |
Instantiate(smokePrefab, transform.position, transform.rotation); | |
Destroy(gameObject); | |
} |
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/sh | |
if [ ! "$EUID" = "0" ] ; then | |
echo "need sudo" 1>&2 | |
exit 1 | |
fi | |
apt-get install libcrypt-openssl-rsa-perl libio-socket-inet6-perl libao-dev avahi-utils avahi-discover avahi-daemon libnss-mdns mdns-scan | |
service avahi-daemon start | |
perl -MCPAN -e 'install Crypt::OpenSSL::RSA' |
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 | |
accept() { | |
RAW='FALSE' | |
while getopts r: opt | |
do | |
case $opt in | |
r) RAW='TRUE' ;; | |
esac | |
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
#!/bin/zsh | |
alias quit=killterm | |
killterm(){ | |
_WIN=$(( `w | wc -l`-3 )) | |
_PID=`ps ax | grep Terminal | grep -v grep | sed -e 's/ *\([0-9]*\).*/\1/g'` | |
[[ -z ${WINDOW} ]] && [[ 1 -eq ${_WIN} ]] && [[ -n ${_PID} ]] && kill ${_PID} | |
exit | |
} |
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/php | |
<?php | |
// 辞書 | |
$dicts = array( | |
array('jp'=>'英単語', 'en'=>'English Words'), | |
); | |
// 生成する識別子の文字数 | |
$n = 4; |
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
<?php | |
class ProcStat{ | |
function upt($f=null){ | |
exec('cat /proc/uptime', $e); | |
preg_match('/(.*) (.*)/', $e[0], $e); | |
if(is_null($f)){ | |
return sprintf('%.0f', $e[1]); | |
} else { |
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/sh | |
echo ja_JP.UTF-8 UTF-8 >> /var/lib/locales/supported.d/local | |
locale-gen | |
dpkg-reconfigure locales |
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/zsh | |
require=false | |
[[ ! -f `which pdftk` ]] && echo 'Require Package pdftk' && require=true | |
[[ ! -f `which convert` ]] && echo 'Require Package convert (ImageMagick)' && require=true | |
if [[ $require == true ]] ; then | |
exit | |
fi |
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
s="abracadabra" ; s=(${(s:a:)s}) ; echo $(($#s[*]+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
(function o(){o()}()) |