Skip to content

Instantly share code, notes, and snippets.

@azyu
azyu / lua_tinker.h
Created June 15, 2014 04:27
lua_tinker call with variadic templates (Visual Studio 2013)
#if _MSC_VER >= 1800
template<typename T, typename ... TArgs>
void push(lua_State *L, T ret, const TArgs& ... args) { push(L, ret); push(L, args...); }
template<typename RVal, typename ... TArgs>
RVal call(lua_State* L, const char* name, const TArgs&... args)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
@azyu
azyu / gacha_ll.cpp
Last active August 29, 2015 14:17
Gacha - Love Live!
#include <random>
#include <iostream>
#include <unordered_map>
std::discrete_distribution<> dist({
90, // 90%
9, // 9%
1, // 1%
});
#include <string>
#include <iostream>
#include <fstream>
#include <regex>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string names;
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int total = 0;
char buf[256];
@azyu
azyu / private.xml
Last active September 22, 2015 15:32
Karabiner 입력기 단축키
<?xml version="1.0"?>
<root>
<item>
<name>Change input source to ENGLISH by left ctrl + command + E</name>
<identifier>private.change_input_source_to_english</identifier>
<autogen>
__KeyToKey__
KeyCode::E, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::VK_CHANGE_INPUTSOURCE_ENGLISH,
KeyCode::VK_WAIT_100MS,
@azyu
azyu / .bash_profile
Created February 5, 2014 13:43
~/.bash_profile
case "${OSTYPE}" in
darwin*)
alias ls="ls -G"
alias ll="ls -lG"
alias la="ls -laG"
;;
linux*)
alias ls='ls --color'
alias ll='ls -l --color'
alias la='ls -la --color'
@azyu
azyu / imas_sc.js
Created May 5, 2018 12:32
Tampermonkey: THE IDOLMASTER SHINY COLORS - background sound enabler
// ==UserScript==
// @name THE IDOLMASTER SHINY COLORS - background sound enabler
// @namespace https://twitter.com/_uyza_
// @version 0.1
// @description Playing sound when browser loses focus
// @author Azyu
// @match https://shinycolors.enza.fun/*
// @grant none
// ==/UserScript==
@azyu
azyu / startup.cmd
Last active December 17, 2020 05:40
.bashrc equivalent for windows cmd shell
@echo off
echo Load alias command...
doskey cd~=cd /D %USERPROFILE%
doskey scoop_update=scoop update *$Tscoop cache rm *$Tscoop cleanup *
@azyu
azyu / install_kube_on_ubuntu.md
Last active June 30, 2021 07:48
Install Kubernetes 1.21 on Ubuntu 20.04

install cri-o

# .conf 파일을 만들어 부팅 시 모듈을 로드한다
cat <<EOF | sudo tee /etc/modules-load.d/crio.conf
overlay
br_netfilter
EOF

modprobe overlay
modprobe br_netfilter