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
console.log(Math.random() * 10 | 0); // => 0 .. 9 in Integer |
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 list = document.getElementsByTagName("input"); | |
var kv = {}; | |
for(var i = 0;i < list.length;i++) { | |
var name = list[i].getAttribute("name") | |
kv[name] = ""; | |
} | |
var json = JSON.stringify(kv).replace(/","/g,"\"\n ,\"").replace(/^\{/,"{\n ").replace(/\}$/, "\n}"); | |
// データを入れる |
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 | |
ip=`ifconfig eth0 | sed -n "s/ *inet addr:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/g p"` | |
echo ${ip} |
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 | |
list=() | |
list+=("date '+%Y/%m/%d %H:%M:%S'") | |
list+=("date '+%Y-%m-%d %H:%M:%S'") | |
list+=("date '+%Y-%m-%d'") | |
for((i = 0; i < ${#list[@]}; i++)) | |
do | |
echo ${list[$i]} | bash |
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 | |
array=() | |
array+=(date) | |
array+=(ls) | |
array+=(pwd) | |
for e in ${array[@]} | |
do | |
echo ${e} | bash |
NewerOlder