Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🎯
Focusing

koji koji

🎯
Focusing
View GitHub Profile
@koji
koji / poetry_commands.md
Created April 2, 2024 03:45
poetry commands
# create a new project
poetry new {project_name}

# add a package
poetry add {package_name}

# install dependencies
poetry install
@koji
koji / pr_count.py
Created December 21, 2023 07:34
count the prs you merged in 2023
import json
import subprocess
# This script requires gh command if you don't have it, you need to install.
# Run the gh command and get the output
user_id = input('Enter your github id: ')
repo_owner = input('Enter repo owner: ')
repo = input('Enter repo name: ')
limit = input('Enter limit num: ')
@koji
koji / DockerFile_commands_note.md
Last active November 25, 2023 19:43
DockerFile note

remove cache

RUN apt autoremove -y &&\
  apt-get clean &&\
  rm -rf /usr/local/src/*

pip

#!/bin/bash

folder_path="./protocols"
output_file="./simulate_output.txt"

for file_path in $folder_path/*.py; do
  echo "run $file_path" >> "$output_file"
  output=$(opentrons_simulate "$file_path")
 echo "$output" >> "$output_file"
@koji
koji / prevent_wsl_auto_file_creation.md
Created December 15, 2022 02:26
Prevent wsl's auto file creation resolv.conf

when running wsl, wsl creates resolv.conf and add useless nameserver. the following is to prevent that.

zsh

sudo rm /etc/resolv.conf
sudo zsh -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo zsh -c 'echo "[network]" > /etc/wsl.conf'
sudo zsh -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
@koji
koji / return.md
Created August 13, 2021 05:43
TikTokApi
{
   "id":"6980139750690950405",
   "desc":"#umortiktok #umor2021 #viraltiktok #sonrriesoloeshumor🤣",
   "createTime":1625190436,
   "video":{
      "id":"6980139750690950405",
      "height":1024,
      "width":576,
      "duration":8,
@koji
koji / tmp_script_for_nextjs.md
Last active May 8, 2021 20:19
Temporary script for
#!/bin/bash
# create tsconfig.json
echo "Create tsconfig.json"
touch tsconfig.json

# install packages for typescript
echo "install packages"
YARNCOMMAND='yarn add --dev typescript @types/react @types/node'
if $YARNCOMMAND ; then
@koji
koji / sparkar_nativeui.js
Last active January 12, 2021 04:03
Native UI Picker for SparkAR Studio
const Scene = require("Scene");
const NativeUI = require("NativeUI");
const Textures = require("Textures");
const Materials = require("Materials");
(async function () {
const button1 = await Textures.findFirst("texture0");
const button2 = await Textures.findFirst("texture1");
const button3 = await Textures.findFirst("texture2");
@koji
koji / js_hashmap.md
Created July 31, 2020 05:16
js hashmap
var intersect = function(nums1, nums2) {
    const result = [];
    hashMap = {};
        
    for(let i=0; i<nums1.length; i++) {
        // console.log(num);
        if(hashMap[nums1[i]]) {
            hashMap[nums1[i]] +=1;
 } else {
@koji
koji / create_crt.md
Last active July 19, 2020 05:51
create .crt file
$ openssl genrsa 2048 > server.key
$ openssl req -new -key server.key > server.csr
$ openssl x509 -days 3650 -req -signkey server.key < server.csr > server.crt

ssl
server.key
server.csr
server.crt