Skip to content

Instantly share code, notes, and snippets.

@katsuobushiFPGA
katsuobushiFPGA / run.bat
Last active January 14, 2025 05:40
指定したフォルダ内のSQLファイルをすべて実行するbat
@echo off
REM psql.exe のパスを指定
set PSQL="psql"
REM データベース名, ユーザー, パスワードを指定してください
SET HOST=localhost
SET PORT=5432
set DATABASE=postgres
set USER=postgres
0
1
2
3
4
5
6
7
8
9
package main
import (
"bufio"
"fmt"
"math"
"os"
"reflect"
"strconv"
"strings"
@katsuobushiFPGA
katsuobushiFPGA / count.gtpl
Created February 1, 2020 10:00
Build Web Application With Golang の Sessionのサンプル
<html>
<head>
<title></title>
</head>
<body>
count: {{.}}
</body>
</html>
package main
import (
"crypto/md5"
"fmt"
"html/template"
"io"
"log"
"net/http"
"net/url"
@katsuobushiFPGA
katsuobushiFPGA / competitive.go
Last active April 24, 2020 08:21
for competitive programming
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
// "regexp"
)
@katsuobushiFPGA
katsuobushiFPGA / archive.sh
Last active October 14, 2018 09:57
Gitプロジェクトのあるコミットからあるコミットの変更後 変更前ソースの差分を取得するシェル
#!/bin/bash
# archive.sh
# 変更後 変更前ソースの差分を格納するシェルです。
#
# 引数1 : 抽出したいコミットID from
# 引数2 : 抽出したいコミットID to
# 引数3 ファイルのzip名
# 引数4 プロジェクトフォルダのフルパス
mpdf
https://gray-code.com/php/output-to-pdf-file-by-mpdf-libraries/
(window.open('', '_self').opener = window).close();
<?php
class SimpleXMLExtended extends SimpleXMLElement
{
public function addCData($cdata_text)
{
$node= dom_import_simplexml($this);
$no = $node->ownerDocument;
$node->appendChild($no->createCDATASection($cdata_text));
}