This file contains hidden or 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
##################################################################### | |
# converting bit stream into ascii string # | |
# author: ptantiku # | |
# # | |
# compile: gcc conv_bin2str.s -o conv_bin2str # | |
# usage: conv_bin2str <binary string> # | |
# example: conv_bin2str 0110100001100101011011000110110001101111 # | |
##################################################################### | |
.data |
This file contains hidden or 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
def shift(str, n) | |
before = [*'a'..'z'].join | |
after = [*'a'..'z'].rotate(n).join | |
str = str.tr(before, after).tr(before.upcase, after.upcase) | |
return str | |
end | |
str = 'Myxqbkdevkdsyxc, iye wkno sd!!' | |
26.times{|i| | |
puts "#{i}: #{shift(str,i)}" |
This file contains hidden or 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
for i in {1..36} | |
do | |
curl -s http://www.etda.or.th/etda_website/category/publications.html/page:$i | \ | |
grep -P 'content.*class="news"' | \ | |
sed -re 's/ +//g' -e 's/^.*href="([^"]+)".*>(.*)<\/a>.*/\2\thttp:\/\/www.etda.or.th\1/' | |
done | tee out.txt |
This file contains hidden or 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
watch -n 1 'diff=$(( $(date +%s -d "16:00") - $(date +%s) )); echo $(( $diff / 60 ))":"$(( $diff % 60 ))' |
This file contains hidden or 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 emolist=[ | |
{"chars" : " :) ", "class" : "emoticon_smile", "name" : "Smiley"}, | |
{"chars" : " :( ", "class" : "emoticon_frown", "name" : "Frown"}, | |
{"chars" : " :P ", "class" : "emoticon_tongue", "name" : "Tongue"}, | |
{"chars" : " :D ", "class" : "emoticon_grin", "name" : "Grin"}, | |
{"chars" : " :o ", "class" : "emoticon_gasp", "name" : "Gasp"}, | |
{"chars" : " ;) ", "class" : "emoticon_wink", "name" : "Wink"}, | |
{"chars" : " :v ", "class" : "emoticon_pacman", "name" : "Pacman"}, | |
{"chars" : " >:( ", "class" : "emoticon_grumpy", "name" : "Gruñón"}, | |
{"chars" : " :/ ", "class" : "emoticon_unsure", "name" : "Unsure"}, |
This file contains hidden or 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 | |
fromdate=$(date -d 2013-08-01 +"%Y%m%d") | |
todate=$(date +"%Y%m%d") | |
filter="สนามบินสุวรรณภูมิ" | |
for year in {2013..2014} | |
do | |
for month in {1..12} | |
do |
This file contains hidden or 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 | |
# Downloading stock data, one file per date | |
# required packages: php5-cli wget | |
# downloaded files have format of: name, date(yymmdd), open, high, low, close, volume(stocks), value(baht) | |
$start_year = 2003; | |
for($y=$start_year; $y<=2014; $y++){ | |
for($m=1; $m<=12; $m++ ){ |
This file contains hidden or 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 | |
prefix_ip='10.10.10' | |
#collecting | |
for i in `seq 1 255` | |
do | |
wget --connect-timeout=1 -t 1 -O "$prefix_ip.$i.rom-0" "http://$prefix_ip.$i/rom-0" | |
done |
This file contains hidden or 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 | |
############################################################################### | |
### For finding all secret codes in android ### | |
############################################################################### | |
# author: @ptantiku | |
# | |
# refer: http://forum.xda-developers.com/showthread.php?t=540483 | |
# | |
# ***************************************************************************** |
This file contains hidden or 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
class User{ | |
public Integer money; | |
public User(Integer money){ | |
this.money = money; | |
} | |
public Integer getMoney(){ | |
return this.money; | |
} |