Skip to content

Instantly share code, notes, and snippets.

View pinebright's full-sized avatar

Kosuke MATSUOKA pinebright

View GitHub Profile
@pinebright
pinebright / MACOS_CLANG_TIDY.md
Last active August 7, 2022 14:39 — forked from sleepdefic1t/MACOS_CLANG_TIDY.md
brew clang-tidy on macOS
brew install llvm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"

use cmake file

  find_program(CLANG_TIDY_BIN clang-tidy)
 find_program(RUN_CLANG_TIDY_BIN /usr/local/Cellar/llvm/10.0.0_3/share/clang/run-clang-tidy.py)
@pinebright
pinebright / swap_alt_cmd_in_microsoft_remote_desktop.json
Created June 9, 2021 09:40
[karabiner-elements]ALT <=> CMD in Microsoft Remote Desktop
{
"title": "ALT <=> CMD in Microsoft Remote Desktop",
"rules": [
{
"description": "Swap option and command in Autodesk Maya",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_option",
@pinebright
pinebright / translate.js
Created October 2, 2020 03:31
Google翻訳拡張機能では非対応のサイトで「Google自動検出→日」するブックマークレット
javascript:location.href="https://translate.google.com/translate?sl=auto&tl=ja&js=n&prev=_t&hl=ja&ie=UTF-8&u="+encodeURIComponent(location.href)+"&act=url"
@pinebright
pinebright / bak
Created May 8, 2020 06:05
バックアップコマンド
#!/bin/sh
if [ "$1" = "-h" ]; then
echo "Usage: bak FILENAME"
else
mv $1 $(date "+%Y%m%d%H%M%S")_$1
fi
@pinebright
pinebright / test_color.sh
Created May 8, 2020 05:33
bashでLS_COLORSをチェックするスクリプト
#!/usr/bin/env bash
IFS=:
for item in ${LS_COLORS}; do
color="$(echo ${item} | awk -F= '{print $2}')"
name="$(echo ${item} | awk -F= '{print $1}')"
case ${name} in
"no") name="global default";;
"fi") name="normal file";;
@pinebright
pinebright / searchOnAirDate.py
Created September 22, 2019 03:24
番組名と話数から放送日時を調べるコード (refs しょぼいカレンダー http://cal.syoboi.jp)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import urllib.request
from datetime import datetime, timezone, timedelta
def get_tid(title):
@pinebright
pinebright / createWordList.py
Created September 1, 2019 00:55
dele で類推されるパスワードの生成に使っていたPythonスクリプトの再現
import argparse
import itertools
parser = argparse.ArgumentParser()
parser.add_argument('words', nargs='*')
parser.add_argument('--output', '-o')
args = parser.parse_args()
@pinebright
pinebright / Makefile
Created March 27, 2019 11:35
汎用的なmakefile
CC = $(CROSS_COMPILE)gcc
STRIP = $(CROSS_COMPILE)strip
CFLAGS = -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
INCLUDES = -I$(DEVROOT)/include
LDFLAGS = -L$(DEVROOT)/lib
LIBS =
SRCS = $(foreach srcdir, $(shell find ./src -type d), $(wildcard $(srcdir)/*.c))
OBJS = $(subst ./src/, ./obj/, $(SRCS:.c=.o))
DEPS = $(OBJS:.o=.d)
TARGETS = program_name
@pinebright
pinebright / monokai-ricty-discord-powerline.json
Created November 20, 2018 03:43
concfg用設定 (monokai, ricty diminished discord w/ powerline pathed)
{
"cursor_size": "small",
"font_face": "Ricty Diminished Discord for Po",
"font_size": "0x14",
"popup_colors": "dark_red,dark_blue",
"dark_gray": "#f92672",
"screen_colors": "dark_magenta,black",
"dark_green": "#49483e",
"command_history_no_duplication": false,
"window_size": "80x25",
@pinebright
pinebright / file1.sh
Last active February 16, 2018 12:14
[C]同じ実行ファイルをシンボリックリンク名で使い分けるサンプルコード ref: https://qiita.com/pinebright/items/6eb5254e6d01bdebb46b
$ gcc main.c
$ ln -s a.out test_a
$ ln -s a.out test_b
$ ./test_a
test_a: called
$ ./test_b
test_b: called