Skip to content

Instantly share code, notes, and snippets.

@shigemk2
shigemk2 / highcharts-line.html
Last active February 22, 2019 02:33
highchartsで折れ線グラフを作ってみました
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>hoge</title>
</head>
<body>
<div id="container" style="width: 100%; height: 400px"></div>
<script type='text/javascript' src='./js/jquery-1.4.4.min.js'></script>
<script type="text/javascript" src="./js/highcharts.js"></script>
@shigemk2
shigemk2 / and.1
Created November 12, 2017 16:23
fish shell and manual pages
.TH "and" 1 "Mon Nov 13 2017" "Version 2.6.0" "fish" \" -*- nroff -*-
.ad l
.nh
.SH NAME
\fBand\fP - conditionally execute a command
.PP
.SS "Synopsis"
.PP
.nf
@shigemk2
shigemk2 / composer.json
Last active October 29, 2017 14:33
PHPでBigQueryのテーブルにデータをアップロードするサンプル
{
"require": {
"php": ">=5.4",
"google/cloud-bigquery": "^0.2"
},
"require-dev": {
"phpunit/phpunit": "~4"
}
}
object HelloWorld {
def main(args: Array[String]) :Unit = {
println("hello, world")
}
}
@shigemk2
shigemk2 / pdfwordconter
Last active August 20, 2016 09:56
PDF English Word Counter
pdftotext "$1" - | tr " " "\n" | sort | uniq -ic | sort -gr
@shigemk2
shigemk2 / sizeav.sh
Created March 31, 2013 07:38
ディレクトリを除く、ディレクトリ内のファイルサイズの平均を取得する
#!/bin/sh
# This script shows file-size average
ls -lF | grep -v / | awk '
{ sum += $5 } END { ave = 0; ave = sum / (NR-1) / 1024; if(ave < 1024) { printf("%3.2f%s\n", ave, "KB"); } else { ave /= 1024 ; printf("%3.2f%s\n", ave, "MB"); } }
'
(defparameter *nodes* '((living-room (you are in the living-room.
a wizard is snoring loudly on the couch.))
(garden (you are in a beautiful garden.
there is a well in front of you.))
(attic (you are in the attic.
there is a giant welding torch in the corner.))))
(defparameter *edges* '((living-room (garden west door)
(attic upstairs ladder))
(garden (living-room east door))
@shigemk2
shigemk2 / flatMap.scala
Created March 26, 2016 14:02
flatMapのサンプル
case class Student(name: Option[String], age: Option[Int], grade: Option[Int])
val list = List(
Some(Student(Some("Steve"), Some(15), Some(1))),
Some(Student(Some("Chad"), Some(16), Some(2))),
Some(Student(Some("Shigeru"), Some(40), Some(1))),
Some(Student(Some("Chloé"), Some(18), Some(3)))
)
println(list.flatMap(_.get.name))
@shigemk2
shigemk2 / for.scala
Created March 26, 2016 13:49
forのサンプル
case class Student(name: String, age: Int, grade: Int)
val list = List(
Student("Steve", 15, 1),
Student("Chad", 16, 2),
Student("Shigeru", 40, 1),
Student("Chloé", 18, 3)
)
val students = for {
@shigemk2
shigemk2 / Max3.java
Created December 25, 2013 15:32
あるごりずむのやつ
import java.util.Scanner;
class Max3 {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in); // 標準入力ストリーム
System.out.println("三つの整数の最大値を求めます");
System.out.println("aの値: ");
int a = stdIn.nextInt(); // 入力
System.out.println("bの値: ");