Skip to content

Instantly share code, notes, and snippets.

@yosida95
yosida95 / nginx.conf
Created February 9, 2022 18:07
NGINX config pitfall
http {
server {
server_name example.net;
listen 80;
types {}
default_type text/plain;
set $12 "Hello";
@yosida95
yosida95 / README.md
Created January 12, 2022 14:08
CO2-mini
$ sudo apt-get install \
    python3-dev \
    librrd-dev \
    libudev-dev \
    libusb-1.0-0-dev
$ python3 -m pip install wheel
$ python3 -m pip install hidapi rrdtool
@yosida95
yosida95 / dmarc.go
Created June 1, 2021 18:08
DMARC report parser
package main
import (
"context"
"encoding/xml"
"flag"
"log"
"net"
"os"
"time"
@yosida95
yosida95 / vlcloop.scpt
Last active June 10, 2020 05:49
Jump VLC position to the beginning of the track and go to next track on the playlist when reached the end of the current track
#!/usr/bin/osascript
on run argv
set startMargin to 55
set stopMargin to 115
if (count of argv) = 0 then
# use the default
else if (count of argv) = 2 then
set startMargin to item 1 of argv
@yosida95
yosida95 / chromedp.go
Created May 22, 2020 14:36
Save a webpage as a PDF file using Headless Google Chrome with Go's chromedp/chromedp
package main
import (
"context"
"flag"
"io/ioutil"
"github.com/chromedp/cdproto/page"
"github.com/chromedp/cdproto/runtime"
"github.com/chromedp/chromedp"
package main
import (
"encoding/json"
"flag"
"log"
"net"
"strings"
)
@yosida95
yosida95 / Is this your github: yosida95?
Created February 13, 2019 07:37
FUTURE TECH JAPAN
Dear Yoshida-san,
My name is XXX XXX. I came across your online profile and github @yosida95. If this is not your github account, please tell me and I will correct my records.
突然の英語のメール、大変申し訳ございません。是非日本語でもご返事ください。
I am a Software Engineer Recruiter based in Tokyo. I am working closely with the #1 ranked tech startup in Japan to hire for software engineer positions. The company is famous in the areas of machine learning, data science, NLP, microservices, and content curation. During 2018, many new faces joined their company from companies like LINE, DeNA, CyberAgent, and Google.
Based on what I saw online, I think you might be strongly matched for one of their engineering positions, either staff or manager/VP level based on experience. In particular I saw a list of skills you have that seem relevant including Python, Javascript, Object-oriented Programming, django, C, vim script, HTML, Go, YAML, CSS.
@yosida95
yosida95 / pre-commit
Created April 13, 2018 09:46
Check Java format against google-java-format and prevent git commit if found violations
#!/usr/bin/env bash
google_java_format=$HOME/.local/lib/google-java-format-1.5-all-deps.jar
[ -f "$google_java_format" ] || exit 1
git diff --name-only --cached| {
code=0
while IFS= read -r file; do
[ -f "$file" ] || continue
case "$file" in
@yosida95
yosida95 / com.yosida95.duplicity-backup.plist
Last active May 22, 2020 14:50
Take macOS backups at every 4:00 a.m. using Duplicity
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yosida95.duplicity-backup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/yosida95/.local/bin/duplicity-backup.sh</string>
</array>
@yosida95
yosida95 / vim.rest
Last active July 21, 2023 09:34
Building Vim 8.0 from Source Code on Ubuntu 14.04
$ sudo apt-get build-dep vim-nox

$ sudo apt-get install luajit libluajit-5.1-dev libncurses-dev libperl-dev python3-dev ruby-dev

$ git clone https://github.com/vim/vim.git

$ cd ./vim