Skip to content

Instantly share code, notes, and snippets.

View andrewzah's full-sized avatar
๐ŸŠ
currently working on Korean educational tools.

Andrew Zah andrewzah

๐ŸŠ
currently working on Korean educational tools.
View GitHub Profile
@andrewzah
andrewzah / danmuji.nix
Last active July 29, 2019 23:02
rust alpine nix test
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
alpine-3-8 = pkgs.dockerTools.pullImage {
imageName = "alpine";
imageDigest = "sha256:0p313r6ra7k5bznqcp2nl7rbcjjz1cw1daywmjq1cmwn948hbiys";
sha256 = "0namvnkvdwsjfijyrzf64prsrzd9b35nhv4yi97mqy9dmlbys2iy";
os = "linux";
arch = "x86_64";
{ lib, buildRustCrate, buildRustCrateHelpers }:
with buildRustCrateHelpers;
let inherit (lib.lists) fold;
inherit (lib.attrsets) recursiveUpdate;
in
rec {
# adler32-1.0.3
crates.adler32."1.0.3" = deps: { features?(features_."adler32"."1.0.3" deps {}) }: buildRustCrate {
{ pkgs ? import <nixpkgs> {} }: with pkgs;
let
#danmuji = rustPlatform.buildRustPackage rec {
#name = "danmuji-${version}";
#version = "0.1.0";
#src = ${
#};
danmuji = /nix/store/b23ll1r78y6s89k0b4rc625f68x0k9mg-rust_danmuji-0.1.0;
in
--force=true
--host_identifier=windoze
--verbose=true
--debug
--tls_dump=true
--tls_hostname=master
--tls_server_certs=./cacert
--enroll_secret_path=./secret
@andrewzah
andrewzah / output.json
Created August 18, 2019 21:11
grammar forms json ouput
[{"id":1375,"name":"์•„๋ฌด๋ฆฌ ...-ใ„ด/๋Š”๋‹ค์ง€๋งŒ ","typical_example":"ใ€์•„๋ฌด๋ฆฌ ๋ˆ์— ์šด๋‹ค์ง€๋งŒ ใ€‘","translation":"Adverb ์•„๋ฌด๋ฆฌ flags an upcoming concessive form, which here is contracted from -(์œผ)ใ„ด/๋Š”๋‹ค[๊ณ  ํ•˜]์ง€๋งŒ no matter how much one might VERB ...; VERB as one might, (nonetheless) ... ; no matter how (much one might, much NOUN is) ... Cf. the adverbs ์•”๋งŒํ•ด๋„ and ์•„๋ฌด๋ž˜๋„ (from ์•„๋ฌด๋ฆฌ ํ•ด๋„) do what you might, say what you wish; nonetheless, all the same, no matter what one does or says. ","category_eng":"()","category_kor":"๊ด€์šฉ๊ตฌ"},{"id":340,"name":"-ใ„ด๋‹ค๋Š”2 NOUN","typical_example":"ใ€๋‚˜๋‚ ์ด ๋‹ฌ๋ผ๊ฐ„๋‹ค๋Š” ์ˆ™์ด ใ€‘","translation":"[The person] who says/claims that ... abbreviated from an indirect quotation in โ€“ใ„ด ๋‹ค[๊ณ  ํ•˜]๋Š”, modifying the following person, etc.","category_eng":"(Modifier/์ค€๊ผด Contraction)","category_kor":"Modifier/์ค€๊ผด Contraction"},{"id":1725,"name":"์ด์™•(์—)","typical_example":"ใ€์ด์™•์— ์ด๋ ‡๊ฒŒ ๋˜์—ˆ์œผ๋‹ˆ ใ€‘","translation":"Already, now that, as long as, since. Usually followed by -๋Š”/-ใ„ด ๊น€์—, but sometimes by -(์œผ)๋‹ˆ.","category_eng":"(Polite Style)","category_kor":"Polite Style"},{"
@andrewzah
andrewzah / process-csv.rb
Created December 2, 2019 15:40
squarespace edit products sample
require 'csv'
file = ARGV[0]
table = CSV.parse(File.read(file), headers: true)
out_table = []
@used_skus = table
.by_col[7]
.map{ |v| v[2..-1] }
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.8.0.1" />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCste7MJ1V5Pttt77ztuybnvh3vohAPjlsqI/w1Uat3jjMdR1RHYgNcoRhUF9ajETi6o0zcVhwHldquCNLeBlSGVrL9eRjG0kmhXV47EjqIibP5AerL1vhQ+qhQkC29yYmUL9eqqsxeVxf+EEoclDB5XT200+4AJJ6vqXcsB6WGltGYXpoZ3wlqSJg4oZJuDR4APqzYxK6MKbQTltsD9BgxpkC7CNIK9Gi364rYNUCr6pOlOinVUpEMh1vQ6WWGfBzTPV28DdIb1Xj4uoytWleXc4VbJ8lsPrPFiObYRaSrZ73dEZRk8xMKUNq4w0Hyt1QqoRTs6zMahmT6UMxP4oW6PyxoSkfAJoy6lis1EKn5dEQ3WNXAlBW3pf3+fAtldtcgM74k2nn6sHUCQa+PpPJLaS6KzjEewWkt3FyxBjk0V+dYllp5+TtDQ+xipgFH2cKPbFLIvD7spapzbDvtJqurx16syChmuVMpQgcW/F9/w1RVqH+r+0uIBZPvaf+YGcg6KSiGqR5kWg5HLRjRwq1jikohO+xGR0l4/nShjbSOtbbggL/7eU1f4K/zPvoWbr9cX6zfCyk8SfI7QegRKz4IJgrcgfbxWhDPmoQGr0naOcm8nWl4CrNGkd6o2PPK//WD1Yl8psK7sVYqegg1vlL2b8A+Zspem+kuOaDZlbdSkQ== zah@andrewzah.com
@andrewzah
andrewzah / error.rs
Last active February 22, 2020 18:27
rust hyper with error handling idea
use std::{fmt, error::Error, result};
pub type AppResult<T> = result::Result<T, AppError>;
#[derive(Debug)]
pub enum AppError {
Generic(String),
Http(http::Error),
Hyper(hyper::error::Error),
@andrewzah
andrewzah / fetch.sh
Last active April 29, 2020 21:43
fetch youtube videos with youtube-dl
#!/usr/bin/env bash
# author: Andrew Zah <zah@andrewzah.com>
# version: v1.0
FETCH_DATA=./data
FETCH_OUTPUT=./output
FETCH_LOGS=./data/logs
general_args=" \