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 / markdown-insert-github-pages-template.el
Last active November 8, 2020 09:18
GitHub Pages用のmarkdownファイルを作成する際に必要な設定や記述などを集めたテンプレートを挿入するためのEmacs lispの関数。
;; Set template for GitHub Pages.
;; See https://pandanote.info/?p=6871 for details.
(defun markdown-insert-github-pages-template (page-title)
"Insert template for GitHub Pages."
(interactive "sTitle: ")
(let ()
(insert (concat
"---\n"
"title: " page-title " - panda大学習帳外伝\n"
"description: \n"
@pandanote-info
pandanote-info / pandanotelink.js
Created November 4, 2020 23:49
HTML5のCustom Elementsを使用してリンク集を挿入するためのタグを定義するためのJavaScriptのコード。
@pandanote-info
pandanote-info / pineleaf.php
Last active September 9, 2020 11:01
Leafletの地図上にデータベースから読み出した緯度・経度及びポップアップの文字列を使って、ポップアップを複数表示させるためのWordpress用のショートコード。
<?php
/*
See https://pandanote.info/?p=6619 for details.
*/
function pineleaf($atts) {
global $wpdb;
$atts = shortcode_atts(array(
"lat" => 35.45585,
"lon" => 139.64204,
"zoom" => 16,
@pandanote-info
pandanote-info / leaflet_markers.sql
Created September 8, 2020 22:06
Leafletに挿すmarkerの情報を保持するためのテーブルをデータベースに作成するためのSQL文。
-- See https://pandanote.info/?p=6619 for details.
drop table if exists leaflet_markers;
create table leaflet_markers (
id int(11) not null auto_increment,
lat float not null,
lon float not null,
popup varchar(4096) not null,
primary key(id)
);
@pandanote-info
pandanote-info / axios_vuejs_example.txt
Created July 24, 2020 07:09
axiosを使ってデータを取得するためのVue.jsの記述例
<script>
new Vue({
el: '#app',
data: {
msg: null,
rawmsg: "",
newad: "",
status: ""
},
methods: {
@pandanote-info
pandanote-info / mariadbfornodejs.txt
Created July 24, 2020 07:02
Node.js用MariaDBへのSQL文の発行例のコード片。
const mariadb = require('mariadb');
const pool = mariadb.createPool({
host: "(ホスト名またはホストのIPアドレス)",
user: "(ユーザ名)",
password: "(パスワード)",
database: "(データベース名)",
connectionLimit: 5
});
const server = http.createServer
@pandanote-info
pandanote-info / staticfilefornodejs.txt
Created July 24, 2020 06:58
Node.js用staticなHTMLファイルの送信用コード例
const fs = require('fs');
const server = http.createServer
(function (request, response) {
var urlp = request.url;
if (別のURLの場合) {
// 中略
} else {
if (urlp == "/") {
urlp += "index.html";
}
@pandanote-info
pandanote-info / HelloWorld.js
Created July 24, 2020 03:25
Node.js用Hello Worldなコード。
// See https://pandanote.info/?p=6505 for details.
const http = require('http');
const server = http.createServer
(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
if (!request.url.endsWith('/')) {
response.end("Hello World!!, ("+request.url+")\n");
} else {
response.end("Hello World!!\n");
@pandanote-info
pandanote-info / HelloWorld.js
Created July 24, 2020 03:25
Node.js用Hello Worldなコード。
// See https://pandanote.info/?p=6505 for details.
const http = require('http');
const server = http.createServer
(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
if (!request.url.endsWith('/')) {
response.end("Hello World!!, ("+request.url+")\n");
} else {
response.end("Hello World!!\n");
@pandanote-info
pandanote-info / kuromoji-ipadic-neologd-20200521.patch
Created June 20, 2020 13:28
kuromojiに最新のNEologdを組み込むためのパッチ(2/2)
--- /dev/null 2020-06-19 08:45:04.478343399 +0900
+++ kuromoji/kuromoji-ipadic-neologd/dictionary/mecab-ipadic-neologd/misc/patch/Noun.proper.reiwa.csv 2020-06-19 14:27:02.321778120 +0900
@@ -0,0 +1 @@
+令和,1288,1288,5904,名詞,固有名詞,一般,*,*,*,令和,レイワ,レイワ
--- kuromoji/kuromoji-ipadic-neologd/dictionary/mecab-ipadic-neologd/libexec/make-mecab-ipadic-neologd.sh.ORG 2020-06-19 14:37:24.771121187 +0900
+++ kuromoji/kuromoji-ipadic-neologd/dictionary/mecab-ipadic-neologd/libexec/make-mecab-ipadic-neologd.sh 2020-06-19 12:27:44.056021722 +0900
@@ -227,6 +227,8 @@
patch < ${BASEDIR}/../misc/patch/Noun.csv.20170317.diff
patch < ${BASEDIR}/../misc/patch/Noun.name.csv.20170317.diff