Skip to content

Instantly share code, notes, and snippets.

View tkmru's full-sized avatar
💭
🍣 💰 🍖 🍶

@tkmru tkmru

💭
🍣 💰 🍖 🍶
View GitHub Profile
@tkmru
tkmru / Keybase.md
Last active February 9, 2023 03:37

Keybase proof

I hereby claim:

  • I am tkmru on github.
  • I am tkmru (https://keybase.io/tkmru) on keybase.
  • I have a public key ASAAqfLTCnJPkuGs-MADQjzOvd3PXw3wh4fA_FYsXDMw2Ao

To claim this, I am signing this object:

$ adb shell input text pp
$ adb shell input keyevent ENTER
$ adb shell input keyevent KEYCODE_DPAD_DOWN
$ adb shell input keyevent DPAD_RIGHT
$ adb shell input keyevent DPAD_CENTER
@tkmru
tkmru / ag_replace.txt
Created April 23, 2018 04:07
ag replace command
ag -l project_a | xargs sed -i '' -e 's/project_a/project_b/g'

Another way is to use Git's "filter-branch" command. It allows you to batch-process a (potentially large) number of commits with a script. You can run the below sample script in your repository (filling in real values for the old and new email and name):

https://www.git-tower.com/learn/git/faq/change-author-name-email

$ git filter-branch --env-filter '
WRONG_EMAIL="wrong@example.com"
NEW_NAME="New Name Value"
NEW_EMAIL="correct@example.com"
-targetlibinfo
-tti
-tbaa
-scoped-noalias
-assumption-cache-tracker
-profile-summary-info
-forceattrs
-inferattrs
-ipsccp
-globalopt
$ dagger/build/bin/opt -O3 -debug-pass=Structure -S opaque_predicate_test.ll -o opaque_predicate_test_opted.ll
Pass Arguments: -tti -tbaa -scoped-noalias -assumption-cache-tracker -targetlibinfo -verify -simplifycfg -domtree -sroa -early-cse -lower-expect
Target Transform Information
Type-Based Alias Analysis
Scoped NoAlias Alias Analysis
Assumption Cache Tracker
Target Library Information
FunctionPass Manager
Module Verifier
Simplify the CFG
Array(params[:ids]).each do |id|
# ...
end
@tkmru
tkmru / isExist.go
Created October 29, 2017 09:04
file exist check
import (
"os"
"log"
)
func isExist(filename string) bool {
_, err := os.Stat(filename)
return err == nil
}
@tkmru
tkmru / commit_msg_today.sh
Last active April 17, 2018 07:15
extract today commit message on mac for daily report.
git log --after=$(date -v-1d +"%Y-%m-%d") --pretty=oneline --abbrev-commit;
@tkmru
tkmru / environment_var_guard.py
Created September 12, 2017 04:52
change env variable for using EnvironmentVarGuard
import unittest
from test.support import EnvironmentVarGuard
class TestConnection(unittest.TestCase):
pass
if __name__ == "__main__":
env = EnvironmentVarGuard()
env.set('DEVELOP_USER', 'test_user')
env.set('DEVELOP_PASSWORD', 'test_password')