Skip to content

Instantly share code, notes, and snippets.

View josix's full-sized avatar
🐍

Josix josix

🐍
View GitHub Profile
git log -1 --no-merges --name-only --pretty=format:"" | sort -u
.bumpversion.cfg
.env
.env.dev
.gitbook.yaml
.github/CODEOWNERS
.github/ISSUE_TEMPLATE/bug-report.md
.github/actions/build-and-push-branch/action.yml
.github/actions/build-branch/action.yml
@josix
josix / resize.py
Created August 5, 2022 08:11
resizing all given image arguments in the CLI
import argparse
from pathlib import Path
from PIL import Image
parser = argparse.ArgumentParser(description='Process some images...')
parser.add_argument('image_paths', metavar='img_path', type=str, nargs='+',
help='image path for resizing')
args = parser.parse_args()
@josix
josix / split_exported_lln.py
Created August 5, 2022 08:00
Splitting exported saved items from Language Reactor according to their language code in the tags. It only supports Japanese and English now.
import csv
from typing import TextIO
from dataclasses import dataclass
en_cards: list = []
ja_cards: list = []
@dataclass
class CardResource:
@josix
josix / elasticsearch.docker-compose.yml
Last active June 19, 2021 08:19
Running elasticsearch by running `docker-compose up`
version: '3.4'
services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.0
ports:
- 9200:9200
environment:
discovery.type: "single-node"
@josix
josix / test_embedding.py
Created October 26, 2020 14:35
test_embedding.py
import sys
import argparse
import random
import json
from collections import defaultdict
from itertools import zip_longest
from math import sqrt, isnan
import multiprocessing as mp
parser = argparse.ArgumentParser(description='Argument Parser')
@josix
josix / Makefile
Created March 25, 2019 10:59 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@josix
josix / gist:81f6c21381faa9710233aab9f317c605
Created February 12, 2019 16:21 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@josix
josix / Vim_cheatsheet.md
Last active September 28, 2018 09:41
Vim instruction cheatsheet
:reg "to show registers
Vri "for resplacing all characters in the line with 'i'
:g/^$/d "delete empty lines
"1p "paste register 1's value.
daw "cut a word including the trailling whitespace.
diw "cut a word exculding the surrounded whitespaces.

Shell Command Note

awk

Scenario

When you don't want to print certain column.

awk '{$1="", $2=""}; print $0' FILE

For pattern maching a column.

if ($1 ~ /regex/) {...}

Prerequisites: Basic Functional Programming in Haskell

Liang-Ting Chen

The first part of the following questions requires basic understanding of how to define a function in Haskell. The second part is a recursive function using techniques you should have learned from the first 4 chapters of Learn You a Haskell for Great Good!. Please check your answer using the interactive interpreter ghci before submission. If you are not familiar with the command-line interface, please read the first chapter of Real World Haskell.