Skip to content

Instantly share code, notes, and snippets.

View kakkun61's full-sized avatar
🚂
Choo-choo

Kazuki Okamoto kakkun61

🚂
Choo-choo
View GitHub Profile
@kakkun61
kakkun61 / Main.hs
Last active February 13, 2018 09:39
Data Types A La Carte
-- http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
main :: IO ()
#!/usr/bin/env bash
set -e
GCC_PATH=/usr/local/bin/gcc
usage() {
echo "$(basename $0) [fsf/apple]" >&2
}
@kakkun61
kakkun61 / Main.hs
Last active February 4, 2018 11:38
手続き Haskell
module Main where
import Prelude hiding (break)
import Control.Monad (when)
import Control.Monad.Cont (callCC, ContT, runContT)
import Control.Monad.IO.Class (liftIO)
import qualified Data.Foldable
import Data.IORef (newIORef, readIORef, writeIORef)
import qualified Data.Traversable
λ stack exec pacman -- -S -y mingw64/mingw-w64-x86_64-zlib
λ stack exec pacman -- -Ql mingw-w64-x86_64-zlib
#include<stdio.h>
#include<stdlib.h>
#define COMMAND_SIZE 256
int main(int argc, char **argv) {
char *mysql_config="C:\\Strawberry\\perl\\bin\\perl.exe /tools/mysql/current/bin/mysql_config.pl";
char command[COMMAND_SIZE];
if (argc == 0) {
@kakkun61
kakkun61 / README
Last active April 24, 2017 22:23
identifyForm bug when there are 2 form and one of them have no field (already fixed https://github.com/yesodweb/yesod/pull/1340)
to write this later
using System;
using System.Collections.Generic;
class CounterHashSet<T>
{
Dictionary<T, int> container;
public CounterHashSet()
{
container = new Dictionary<T, int>();
@kakkun61
kakkun61 / idiff.sh
Last active March 8, 2017 04:02
IDEA diff for macOS with JetBrains Toolbox
~/"Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/$(ls ~/Library/Application\ Support/JetBrains/Toolbox/apps/IDEA-C/ch-0 | sort -r | head -1)/IntelliJ IDEA CE.app/Contents/MacOS/idea" diff "$1" "$2"
#define STRING_SIZE 50
#define SELECT_SAMPLE "SELECT col1, col2, col3, col4 \
FROM test_table"
MYSQL_STMT *stmt;
MYSQL_BIND bind[4];
MYSQL_RES *prepare_meta_result;
MYSQL_TIME ts;
unsigned long length[4];
#define STRING_SIZE 50
#define DROP_SAMPLE_TABLE "DROP TABLE IF EXISTS test_table"
#define CREATE_SAMPLE_TABLE "CREATE TABLE test_table(col1 INT,\
col2 VARCHAR(40),\
col3 SMALLINT,\
col4 TIMESTAMP)"
#define INSERT_SAMPLE "INSERT INTO \
test_table(col1,col2,col3) \
VALUES(?,?,?)"