Skip to content

Instantly share code, notes, and snippets.

@MasWag
MasWag / cancel.gs
Last active August 29, 2015 14:13
ISの休講補講情報を取得してGoogle Calendarに格納するGoogle Apps Script。
/*
The MIT License (MIT)
Copyright (c) 2015 Masaki Waga
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@MasWag
MasWag / crop.sh
Created January 15, 2015 06:48
image magicでslideを切ってzipに固めるscript
#! /bin/bash
if [ $# -lt 1 ]; then
echo "usage: $0 [DIR]";
exit 1;
fi
DIR=$1;
MAX=999;
@MasWag
MasWag / flycheck-vhdl-ghdl.el
Last active August 29, 2015 14:16
flycheck rule of vhdl using ghdl
(flycheck-define-checker vhdl-ghdl
"A VHDL syntax checker using ghdl."
:command ("ghdl" "-s" "--std=93" "--ieee=synopsys" "-fexplicit" source)
:error-patterns
((error line-start (file-name) ":" line ":" column
": " (message) line-end))
:modes vhdl-mode)
(flycheck-set-checker-executable 'vhdl-ghdl)
(add-hook 'vhdl-mode-hook
@MasWag
MasWag / lock-sleep.service
Created March 15, 2015 07:22
config file of screen lock with physlock with systemd
[Unit]
Description=Lock session
Before=sleep.target suspend.target hibernate.target
[Service]
Type=forking
ExecStart=/usr/bin/physlock -ds -u calros
[Install]
WantedBy=sleep.target suspend.target hibernate.target
@MasWag
MasWag / kaizoku.latex
Last active April 27, 2018 10:31
pandocの少年団用のlatex出力用template
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
$endif$$if(dir)$$if(latex-dir-rtl)$
\PassOptionsToPackage{RTLdocument}{bidi}
$endif$$endif$%
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{ltjsarticle}
\usepackage{multicol}
\makeatletter
@MasWag
MasWag / report.latex
Created April 17, 2015 02:53
pandocでluatexを使わないtemplate
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{jsarticle}
\usepackage{multicol}
\setlength{\textheight}{232mm}
\setlength{\topmargin}{4.6truemm}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
$if(graphics)$
\usepackage{graphicx}
\makeatletter
@MasWag
MasWag / Omakefile
Created April 17, 2015 02:56
pandocとplatexでmarkdownからdviを生成するOmakefileの例
PANDOC = pandoc
PANDOC_FLAGS = --template=/home/calros/share/pandoc/report.latex -s
%.tex: %.md
$(PANDOC) $(PANDOC_FLAGS) -o $@ $<
# 生成するPDFの名前 (拡張子は不要)
TARGET = test
# LaTeXコマンド
LATEX = platex
@MasWag
MasWag / play_depth.cpp
Created June 14, 2015 12:39
depth's player
#include <OpenNI.h>
#include <opencv2/opencv.hpp>
#include <vector>
#include <stdexcept>
int main(int argc,char* argv[])
{
try {
openni::Status ret = openni::OpenNI::initialize();
if ( ret != openni::STATUS_OK ) {
@MasWag
MasWag / Makefile
Created June 22, 2015 10:43
演習3のslideを作成するためのMakefile.geeknoteを使ってevernoteからmarkdownを作ってpandocでbeamerにしてpdfにする。handoutも作れる。
MDS = 0624.md
TEXS = $(MDS:%.md=%.tex)
DVIS = $(MDS:%.md=%.dvi)
PDFS = $(MDS:%.md=%.pdf)
NUP_PDFS = $(PDFS:%.pdf=%-nup.pdf)
TEX = platex
dvi: $(DVIS)
pdf: $(PDFS)
@MasWag
MasWag / tint2rc
Created September 28, 2015 13:20
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
# Background definitions
# ID 1
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #FFFFFF 16