Skip to content

Instantly share code, notes, and snippets.

View pandanote-info's full-sized avatar

pandanote-info pandanote-info

View GitHub Profile
@pandanote-info
pandanote-info / simple_leaflet_demo.php
Created October 4, 2017 14:47
プラグインを使わずにHTTPS接続で運用されているWordpressの記事内にLeafletで地図を表示させるためのショートコードのサンプル。
<?php
/*
このコードを使用した結果に関しては、いかなる保証も行いませんので、
その点につきましてはあしからずご了承ください。
*/
$_simple_leaflet_demo_map_number = 0;
function simple_leaflet_demo($atts) {
global $_simple_leaflet_demo_map_number;
$atts = shortcode_atts(array(
@pandanote-info
pandanote-info / link_cache_sample.sql
Created October 28, 2017 04:11
Amazon Product Advertising APIを使った広告で、現在までに作成したものを蓄積するためのMariaDBのテーブルの作成用のSQL文のサンプル
@pandanote-info
pandanote-info / quicklatex-format.css.diff
Created November 20, 2017 14:12
WP-QuickLaTeXで表示される数式のうちで、長いものを横スクロールできるようにするためのpatch。
--- quicklatex-format.css.ORG 2017-11-19 15:59:10.197954451 +0900
+++ quicklatex-format.css 2017-11-19 16:36:40.229951065 +0900
@@ -19,7 +19,7 @@
padding:0px !important;
margin:0px !important;
vertical-align:middle !important;
- display:inline-block !important;
+ display:inline-block !important;
}
@pandanote-info
pandanote-info / findmp4inuvdl.py
Created December 31, 2017 09:40
moviefilelist.pyを使って生成したJSONのスクリプトを読み込んで、ちょっとおしゃれなexoファイルを生成するためのPython3のプログラム。
#!/usr/bin/env python
import io
import os
import sys
import json
import subprocess
import codecs
import re
import math
@pandanote-info
pandanote-info / show_engines_result_with_mroonga.txt
Created January 13, 2018 07:48
Mroongaをインストールした後のshow enginesの実行結果。
MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
| MyISAM | YES | MyISAM storage engine
@pandanote-info
pandanote-info / moviefilelist.py
Last active March 21, 2018 05:29
YouTube Data API v3を用いてYouTubeにおけるID、タイトル名、ファイル名及び再生回数をJSONファイルに保存するプログラム
#!/usr/bin/python
import httplib2
import os
import sys
import json
import argparse
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
@pandanote-info
pandanote-info / build.sbt
Created May 1, 2018 08:47
ScalaTestを使用するためのbuild.sbtの設定例。
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
logBuffered in Test := false
@pandanote-info
pandanote-info / ComplexNumberTest.scala
Last active May 1, 2018 10:43
複素数を扱うためのクラスの動作確認用のプログラム例です。
package info.pandanote.test
// Scalaで複素数を扱うためのテスト用のコード例です。
// このコードは無保証であり、使用したことよって得られる結果については一切保証いたしません。
// 詳細は以下のURLを参照いただけると幸いです。
// https://pandanote.info/?p=1849
object ComplexNumberTest {
def main(args: Array[String]): Unit = {
val a = ComplexNumber(-2,4)
@pandanote-info
pandanote-info / ComplexNumberTestClass.scala
Created May 1, 2018 10:45
複素数を扱うためのScalaクラスに対するScalaTest用のテストファイルの記述例。
package info.pandanote.test
import org.scalatest.Assertions
import org.scalatest._
class ComplexNumberTest extends FlatSpec with Matchers {
"a" should "123" in {
val a = "123"
a should be("123")
}
@pandanote-info
pandanote-info / ComplexNumber.scala
Last active June 22, 2018 04:15
Scalaで複素数を扱うためのクラス。BreezeのComplexクラスの実装を参考にしています。
package info.pandanote.test
import scala.reflect.ClassTag
import scala.math._
package info.pandanote.test
import scala.reflect.ClassTag
import scala.math._
// BreezeのComplexクラスを元にして複素数を扱うためのクラスを書いてみました。