Skip to content

Instantly share code, notes, and snippets.

View caiwan's full-sized avatar
🐺

Caiwan caiwan

🐺
View GitHub Profile
@caiwan
caiwan / requirements.txt
Created July 23, 2021 17:25
Uses Google TTS to read up a long text file splitting up to pieces
gTTS
tqdm
@caiwan
caiwan / file2bin.py
Last active August 20, 2020 10:39
Python C/C++ utils
import argparse
import json
import os
import sys
import pathlib
from hashlib import md5
import tqdm
@caiwan
caiwan / mikrovilag_basic_checksum_1988.bas
Last active March 23, 2023 09:38
Mikrovilag magazine, C64 Basic
100 data 78,a9,0d,8d,04,03,a9,c0,8d,05,03,58,1048
110 data 60,a5,14,85,a7,a5,15,85,a8,a9,00,8d,1378
120 data 00,ff,a2,1f,b5,c7,9d,a7,c0,ca,10,f8,1810
130 data a9,13,20,d2,ff,a9,12,20,d2,ff,a0,00,1529
140 data 84,b4,84,b0,88,e6,b4,c8,b9,00,02,f0,1793
150 data 2e,c9,22,d0,08,48,a5,b0,49,ff,85,b0,1547
160 data 68,48,c9,20,d0,07,a5,b0,d0,03,68,d0,1488
170 data e2,68,a6,b4,18,a5,a7,79,00,02,85,a7,1455
180 data a5,a8,69,00,85,a8,ca,d0,ef,f0,ca,a5,1995
190 data a7,45,a8,48,29,0f,a8,b9,97,c0,20,d2,1470
@caiwan
caiwan / downloadAssets.py
Created April 2, 2020 08:22
Download assets from GoogleDrive
"""
taken from this StackOverflow answer: https://stackoverflow.com/a/39225039
"""
import requests
import argparse
import json
import os
@caiwan
caiwan / caiwan_macro_framework.lua
Last active January 10, 2020 19:04
Caiwan's LMC macro framework
-- ------------------------------------------------------------------------------------
-- * Caiwan's LMC macro framework
-- * Usage:
-- * Place this file to <LuaMacros>/lua/caiwan_macro_framework.lua
-- ------------------------------------------------------------------------------------
-- Helpers
function bit(p) return bit32.lshift(1, p) end
@caiwan
caiwan / git-lg-alias
Created April 29, 2019 09:03
Graph view alias for git log
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@caiwan
caiwan / Bootstrap-theme.vue
Created October 25, 2018 12:06
Some feature showoff for bootstrap when dealing w/ theme override
<template>
<div class="container">
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-8 col-md-7 col-sm-6">
<h1>Darkly</h1>
<p class="lead">Flatly in night mode</p>
</div>
</div>
@caiwan
caiwan / components.py
Created September 18, 2018 14:18
Flask + peewee app skeleton
import logging
import inspect
import os
import sys
import inspect
import logging
import json
from datetime import datetime
@caiwan
caiwan / 2D-art-collection.md
Last active June 11, 2018 08:41
Art material collection
@caiwan
caiwan / pub_sub_cpp.cpp
Created June 9, 2018 08:51 — forked from makomweb/pub_sub_cpp.cpp
Fun with C++: implementing a pub/sub scenario using std::bind and other standard facilities. The approach is pretty similar to the well known .NET event mechanism.
#include <iostream>
#include <map>
#include <algorithm>
#include <functional>
#include <memory>
using namespace std;
class EventArgs {
public: