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
import javax.inject.{Inject, Singleton} | |
import akka.stream.Materializer | |
import play.api.Configuration | |
import play.filters.cors.CORSConfig.Origins.Matching | |
import play.filters.cors.{CORSConfig, CORSFilter} | |
import scala.concurrent.ExecutionContext | |
import scala.util.matching.Regex |
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
object Main extends App { | |
def possibleSeq(baseSeq: Seq[Option[Boolean]]): Seq[Seq[Boolean]] = | |
baseSeq.foldLeft(Seq(Seq.empty[Boolean])) { (acc, ele) => | |
ele match { | |
case Some(b) => acc.map(_ ++ Seq(b)) | |
case None => acc.flatMap(s => Seq(s ++ Seq(true), s ++ Seq(false))) | |
} | |
} |
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
mkdir ~/.fonts && cd ~/.fonts | |
wget http://users.teilar.gr/~g1951d/Symbola.zip | |
unzip Symbola.zip && rm Symbola.zip |
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 -eu | |
if [[ $# != 1 ]]; | |
then | |
echo "第一引数にアカウント名を指定してください。" | |
echo "" | |
echo "e.g." | |
echo "$ ./list_policies.sh your_account_name" | |
exit 1 | |
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
import math | |
NUMBER = 100000000 | |
def get_prime_list(limit): | |
limit_sqrt = int(math.ceil(math.sqrt(limit))) | |
prime_bool_list = [False] * 2 + [True] * (limit - 2) | |
for prime_cand in xrange(2,limit_sqrt): | |
if prime_bool_list[prime_cand]: | |
for composite in range(prime_cand ** 2, limit, prime_cand): | |
prime_bool_list[composite] = False |
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
# Attribute codes: | |
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed | |
# Text color codes: | |
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white | |
# Background color codes: | |
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white |
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
wget -q -O - https://twitter.com/accountname/media | egrep "https\S\/\/\S+jpg\"" | awk -F"\"" '{print $2}' | xargs wget -i |
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 | |
set -eu | |
pngFile=$1 | |
headPtr=0 | |
if [ "89504E470D0A1A0A" != $(xxd -ps -u -s $headPtr -l 8 $pngFile) ] | |
then | |
echo "pngファイルではありません" | |
exit 1 | |
fi | |
headPtr=$((headPtr+8)) |
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
Lorenz system in javascript with three.js | |
練習がてらローレンツアトラクタをthree.jsを用いて書いてみた |
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
ruleは | |
1,2,...,16 | |
16, | |
32, | |
: | |
, ... ...,255 | |
と並んでます。 |
NewerOlder