Skip to content

Instantly share code, notes, and snippets.

@aruneko
aruneko / vue2-google-maps.d.ts
Created November 20, 2020 02:56
Type Definitions for Vue2 Google Map
/* eslint-disable */
declare module 'vue2-google-maps' {
import { PluginFunction } from 'vue'
export const install: PluginFunction<{}>
export type googleMaps = typeof google.maps
namespace google.maps {
/** *** Map *****/
class Map extends MVCObject {
constructor(mapDiv: Element | null, opts?: MapOptions)
@aruneko
aruneko / PKGBUILD.sh
Created August 8, 2018 07:50 — forked from laughk/ttf-cica_PKGBUILD.sh
[For Archilinux] 手っ取り早く Cica v3 を使いたかったので AUR の PKGBUILD を以下のように編集して突っ込んだ。
# Maintainer: yuhr <sdn.pate(at)gmail.com>
pkgname=ttf-cica
pkgver=3.0.0
pkgrel=1
pkgdesc="Composite font with Ubuntu Mono and Rounded Mgen+."
url="https://github.com/miiton/Cica"
license=('custom')
arch=('any')
depends=('fontconfig' 'xorg-font-utils')
@aruneko
aruneko / Markov.scala
Created July 3, 2017 06:56
n-gramを作ってランダムに文章を生成するマルコフもどき
package net.aruneko.markov
import scala.annotation.tailrec
import scala.io.Source
import scala.util.Random
object Main {
def main(args: Array[String]): Unit = {
val trigrams = Source.fromResource("kokoro.txt")
.getLines().filter(_ != "")
@aruneko
aruneko / autoDiff.hs
Created May 31, 2017 15:23
Haskellで自動微分
-- 参考: http://www.mathgram.xyz/entry/rust/ad/forward
data Dual = Dual { x :: Double
, dx :: Double
} deriving Show
instance Num Dual where
(Dual x1 dx1) + (Dual x2 dx2) = Dual { x = x1 + x2, dx = dx1 + dx2 }
(Dual x1 dx1) * (Dual x2 dx2) = Dual { x = x1 * x2, dx = dx1 * x2 + x1 * dx2 }
@aruneko
aruneko / cos.c
Last active December 13, 2016 11:35
#include <stdio.h>
#include <math.h>
double fact_rev(int n) {
double result = 1.0;
for (int i = 1; i <= n; ++i) {
result *= 1.0 / i;
}
return result;
}
@aruneko
aruneko / latexCheatSheet.md
Last active February 20, 2023 15:55
LaTeXチートシート

LaTeXチートシート

大まかなテンプレ

\documentclass[a4j, twocolumn, 10pt]{jsarticle}

\title{}
\author{}
\date{}
@aruneko
aruneko / latexmkInstall.sh
Last active August 29, 2015 14:23
latexmkの一発インストールシェルスクリプト(Linux用)
#!/bin/sh
# インストール先ディレクトリの生成と本体のダウンロード
mkdir -p $HOME/opt/latexmk
wget -O $HOME/opt/latexmk/latexmk http://mirrors.ctan.org/support/latexmk/latexmk.pl
# 実行権限とPATHの設定
chmod +x $HOME/opt/latexmk/latexmk
echo 'PATH="$HOME/opt/latexmk:$PATH"' >> $HOME/.bashrc
# 設定ファイルの書き込み
# 参考:http://konn-san.com/prog/why-not-latexmk.html
@aruneko
aruneko / curl_install.sh
Last active February 10, 2017 22:25
HTTP(S)通信のできるcurlと無駄に新しいgawkをインストールしてくれます
#!/bin/sh
cd
mkdir src
mkdir opt
cd ./src
wget http://www.openssl.org/source/openssl-1.1.0b.tar.gz
wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gz --no-check-certificate
wget https://curl.haxx.se/download/curl-7.50.3.tar.bz2 --no-check-certificate
@aruneko
aruneko / build.sh
Created September 23, 2014 10:28
C++のめんどくさいコンパイルを肩代わりしてくれます
#!/bin/sh
g++ -o $1 $1.cpp
if [ ! -e ./bin ]; then
mkdir bin
fi
mv $1 ./bin/