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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func shuffle(a map[int]bool) { | |
rand.Seed(time.Now().UnixNano()) |
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
echo ZONE=\"Asia/Tokyo\" | sudo tee /etc/sysconfig/clock | |
sudo cp -p /usr/share/zoneinfo/Japan /etc/localtime |
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 | |
class AppController extends Controller { | |
public $viewClass = 'App\View\SmartyView'; | |
// ...... | |
} |
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
package main | |
import "fmt" | |
func Collatz(i int) { | |
fmt.Println(i) | |
if i <= 1 { | |
return | |
} |
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
# -fs のオプションが必要 | |
brew reinstall php53 -fs |
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
package main | |
import "fmt" | |
import "math/big" | |
/* | |
2015年東京大学(理科)数学 問5 | |
mを2015以下の正の整数とする | |
2015 C m が偶数となる最小の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
echo 'display notification "メッセージ本体" with title "題名" subtitle "副題"' | osascript |
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 | |
function isUniqueChars($str) { | |
return strlen($str) === count(array_unique(str_split($str))); | |
} | |
var_dump(isUniqueChars('abc')); | |
var_dump(isUniqueChars('aaa')); | |
var_dump(isUniqueChars('12345678901')); |
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 | |
function clockAngle($hour, $min) | |
{ | |
$longAngle = $min*6; | |
$shortAngle = 30*($hour + ($min/60)); | |
return abs($longAngle - $shortAngle); | |
} | |
var_dump(clockAngle(3,0)); | |
var_dump(clockAngle(9,30)); |
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
git remote prune origin && git checkout master && git branch --merged | grep -v \* | xargs git branch -D |