Skip to content

Instantly share code, notes, and snippets.

View yuu's full-sized avatar
:octocat:
every write code

yuu yuu

:octocat:
every write code
View GitHub Profile
@yuu
yuu / .Xresources-hybrid
Created August 22, 2023 14:05 — forked from w0ng/.Xresources-hybrid
Terminal colourscheme for use in hybrid.vim
! Hybrid Terminal Colours. Uses the palette from Tomorrow-Night:
! https://github.com/chriskempson/tomorrow-theme/blob/master/vim/colors/Tomorrow-Night.vim
! vim: ft=xdefaults
*background: #1D1F21
*foreground: #C5C8C6
! black
*color0: #282A2E
*color8: #373B41
! red

Keybase proof

I hereby claim:

  • I am yuu on github.
  • I am yuuxzy (https://keybase.io/yuuxzy) on keybase.
  • I have a public key ASA7f0vj9nrURoTOnkNa-4ZXffoCy-6A_hUP7N0baeyAlwo

To claim this, I am signing this object:

@yuu
yuu / macos-setup-guide.rst
Last active March 1, 2021 10:36
macos setup guide for software enginner
@yuu
yuu / README.md
Last active May 22, 2020 10:47
Dismiss the popup notification in macos notification center #touchbar #bettertouchtool

dismiss the popup notification

BetterTouchTool

-> Touch Bar Trigger Configuration
-> Apple Script
-> Run Apple Script (blocking)

@yuu
yuu / how-to-find-key.md
Last active May 7, 2020 02:18
Find defaults key/value in System Preference with macOS Catalina(10.15.4)

デフォルト値を持っているので、初期状態では出てこない。
画面上で on -> off してやると、値がでてくる。
このオプションを例に上げると:

  1. before cmd 2) on -> off 3) aftercmd
    の結果を diff すると分かる。
$ defaults read > before
@yuu
yuu / ChangeModifierMapping_AppleInternalKeyboard.sh
Created February 29, 2020 05:56
ChangeModifierMapping with Apple Internal Keyboard
#!/bin/bash -x
# https://developer.apple.com/library/archive/technotes/tn2450/_index.html
# https://qiita.com/hetima/items/b475997008dabd567da0
target=`hidutil list |grep 'Apple Internal Keyboard' |head -n 1 |awk 'BEGIN{printf "\{%s","\"VendorID\":"} {printf "%s",$1} {printf "%s",","} {printf "%s","\"ProductID\":"} END{printf "%s\}\n",$2}'`
# 0x700000000
# LeftControl=0xE0
LeftControl=0x7000000E0
@yuu
yuu / properties.rst
Last active November 13, 2019 02:34
[swift] note
@yuu
yuu / defer-do.rst
Last active November 8, 2019 04:31
[swift] why? compiler warnings
xcode:11
target/platform:iOS 13.1
swift:5
warning:'defer' statement before end of scope always executes immediately; replace with 'do' statement to silence this warning
fix-suggest:Replace 'defer' with 'do'
func doSomething(value: Int?, value2: Int?) {
    guard let value = value else { return }
@yuu
yuu / eventfd.md
Created September 5, 2019 07:14
[c++] thread communication using eventfd

sample code wandbox

eventfd is passing counting value.

eventfd_write(fd, 1);
-> read result: 1

eventfd_write(fd, 1);
eventfd_write(fd, 1);
-> read result: 2

@yuu
yuu / hof.cpp
Last active June 21, 2019 00:56
[c++] Higher order functions examples
#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
namespace {
std::vector<int> vec = {1, 2, 3};
void result(bool ret, const char *func) {
printf("%s result: ", func);