Skip to content

Instantly share code, notes, and snippets.

@niyaton
niyaton / hyper-mode-old.json
Created March 15, 2026 10:38
Left Control acts as normal Ctrl with hold; double tap toggles Hyper mode (not work)
{
"description": "Left Control acts as normal Ctrl with hold; double tap toggles Hyper mode",
"enabled": false,
"manipulators": [
{
"conditions": [
{
"name": "left_control_tap_once",
"type": "variable_if",
"value": 1
@niyaton
niyaton / parse.py
Last active December 2, 2022 06:41
Using this scripts, you can get slack message for each session from researchr.org. This script is customized for APSEC2022.
from bs4 import BeautifulSoup
track2track = {
'EDU - Software Engineering Education': 'EDU',
'ERA - Early Research Achievements': 'ERA',
'SEIP - Software Engineering in Practice': 'SEIP',
'Technical Track': 'Technical Track'
}
# This file includes appended modal data.
@niyaton
niyaton / .editorconfig
Last active December 27, 2019 09:36
個人用汎用 editorconfig & .gitattributes
# http://editorconfig.org
root = true
[*]
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
passwd
/etc/init.d/sshd start
mkdir $HOME/.ssh
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhyahXc6freX92BWsjeRZ8Rdw6Oyma/XXab/+fdEHzbV2jGdtqiUzPxDAUXB5gX381EcYZ1BgmmpU1dC4LjZnU+TKd92gFdCdWh+HVnGXP7e7tP5w4f1GpCqZ9X2mlndm91zF7S8+w0aD1BYk6pqaw6eK93CONzCfC+RAfZT+lYMvTZwn+ZUlypUN7szPyRXEYgvNzNfqIhwuWVHItpYw7JezwtZBnwfIF4RmZgGs5GDWQywrY+M1Dsz5VwjGC66bgQubfchD9POX+zCumIXVx2V9UqlkmVl6RZI19e7FMqXH6D5NNNB5uYvSAQZ4fxo7pbvObkCCcIrvXtCbun2aB' > .ssh/authorized_keys
# Checking whther zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/zplug/zplug ~/.zplug
fi
cat <<EOT > ~/.zshrc
# Essential
source ~/.zplug/init.zsh
# zplug check returns true if all packages are installed
#include <stdio.h>
int main(){
int n;
printf("配列のサイズを入力してください");
scanf("%d", &n);
int array[n];
int i;
int a[10]; //配列には適切な値が入っていると仮定する
int tmp; // 一時的に利用する変数.(temporaryの略でtmp)
// a[0]とa[3]を交換する.
tmp = a[0]
a[0] = a[3]; //a[0] = tmpでもよい
a[3] = tmp;
@niyaton
niyaton / hello.c
Created October 9, 2013 21:21
Hello World
#include <stdio.h>
int main(){
printf("Hello World!");
return 0;
}
@niyaton
niyaton / rbenv_init.zsh
Created August 19, 2013 04:29
eval (rbenv init -) とか重いんですよ.
# Initialize rbenv.
# "eval rbenv init -" is much heavy. use cached script.
if [ -n "$(printenv TMUX)" ]; then
source $ZSHHOME/rbenv.init-no-rehash
else
source $ZSHHOME/rbenv.init
fi
check_rbenv_init() {
rbenv init - | diff - $ZSHHOME/rbenv.init
@niyaton
niyaton / fizzbuzz.py
Created June 19, 2013 13:50
なんとなくFizzBuzz書いてみた.
def gen_fizz_buzz(n):
for i in xrange(1,n):
str = ""
if i % 3 == 0:
str += "Fizz"
if i % 5 == 0:
str += "Buzz"
yield str if str else i
for i in gen_fizz_buzz(100):