Skip to content

Instantly share code, notes, and snippets.

View mattak's full-sized avatar
👨‍💻
working

Takuma Maruyama mattak

👨‍💻
working
View GitHub Profile
@mattak
mattak / import-env
Last active July 20, 2023 23:25
import-env
#!/bin/bash
for kv in $(< $1)
do
if [[ "$kv" = ^\s*$ ]] || [[ "$kv" =~ ^# ]]; then
continue
fi
export $kv
done
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattak
mattak / job.md
Last active January 10, 2023 05:50

連絡先

共通

業務形態:

@mattak
mattak / git-prc
Created October 27, 2022 08:29
github pull request creation script
#!/bin/bash
set -e
# optparse
if [ $# -ge 1 ]; then
SOURCE_BRANCH=$1
else
echo "ERROR: source branch not specified"
exit 1
@mattak
mattak / mp4small
Created August 2, 2022 08:27
create small size mp4
#!/bin/sh
set -xe
if [ $# -eq 0 ]; then
echo "usage: <input_mp4>"
exit 1
fi
f1=$1
@mattak
mattak / antlr4
Last active June 21, 2022 13:34
Simple script for using antlr4
#!/bin/sh
set -eu
VERSION="4.10.1"
JAR_DIR="/tmp/antlr4"
if [ ! -d "$JAR_DIR" ]; then
mkdir -p "$JAR_DIR"
@mattak
mattak / launchapp
Last active May 18, 2022 12:29
Launch application from command line.
#!/usr/bin/env ruby
# coding: utf-8
def grep_packages(grep_word)
package_list = `adb shell pm list package`
grep_package_list = package_list.split(/\s+/).map { |line| line.sub(/^package:/, '') }.select { |line| line.include?(grep_word) }
if grep_package_list.size == 1
return grep_package_list[0]
elsif grep_package_list.size > 1
@mattak
mattak / solve_wordle.rb
Created February 2, 2022 09:38
solve wordle puzzle
#!/usr/bin/ruby
# sample.
# {
# "q" => 0.00187529,
# "j" => 0.00309423,
# "z" => 0.00337553,
# "x" => 0.00407876,
# "v" => 0.0114393,
# "w" => 0.0173465,
@mattak
mattak / slackpost.sh
Last active September 3, 2021 08:05
post message to slack
#!bash -e
TOKEN= # slack token is generate from: https://api.slack.com/web
CHANNEL= # name of channels or group
MESSAGE= # message
NICK= # bot name
IS_PRIVATE= # 1 or 0
if [ $IS_PRIVATE -eq 1 ]; then
API_TYPE=groups
using UnityEngine;
namespace App
{
public class CameraFinder : MonoBehaviour
{
public Camera DisposeCamera;
private Canvas _canvas;
// Use this for initialization