Skip to content

Instantly share code, notes, and snippets.

View zynaxsoft's full-sized avatar
🪲
🧊

Tanapol Prucksakorn zynaxsoft

🪲
🧊
View GitHub Profile
use std::collections::VecDeque;
use std::time::Instant;
macro_rules! dump_screen_old {
($lines:expr) => {{
let mut is_first = true;
let mut buf = "".to_owned();
for line in &$lines {
if line.is_canonical && !is_first {
fn main() {
let mut origin = Node::new(1);
let child = Node::new(2);
origin.push(&child);
let iter = NodeIterator {
end: false,
head: &origin,
};
alias l='ls -lFh' #size,show type,human readable
alias la='ls -lAFh' #long list,show almost all,show type,human readable
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
alias ll='ls -l' #long list
alias ldot='ls -ld .*'
alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'
@zynaxsoft
zynaxsoft / obsidian.css
Last active August 20, 2020 07:38
obsidian.css
:root
{
--dark0-hard: #1d2021;
--dark0: #282828;
--dark0-soft: #32302f;
--dark1: #3c3836;
--dark2: #504945;
--dark3: #665c54;
--dark4: #7c6f64;

Keybase proof

I hereby claim:

  • I am zynaxsoft on github.
  • I am zynaxsoft (https://keybase.io/zynaxsoft) on keybase.
  • I have a public key ASChji4940qKjHIbzV0sK9RgvrMttcHMb3qQQxOiDVM6iwo

To claim this, I am signing this object:

@zynaxsoft
zynaxsoft / get_git_version.py
Created March 6, 2020 05:09
Getting version from git repository
class Version:
def __init__(self, master_ver, branch, git_hash):
self.master_ver = master_ver
self.branch = branch
self.hash = git_hash
@classmethod
def from_str(cls, version_str):
version = version_str.split('-')
@zynaxsoft
zynaxsoft / singleton.py
Last active March 2, 2020 05:31
Yet another way to create a singleton in python
#############################
# descriptor version
# (only one class is supported currently)
#############################
class _Singleton:
def __set_name__(self, owner, name):
self.name = name
self.instance_created = False
@zynaxsoft
zynaxsoft / Dockerfile-private-repo
Last active March 6, 2020 05:43
Dockerfile for private repo
FROM python:3.9-rc-buster as intermediate
COPY requirements.txt /app/
WORKDIR /app
ARG SSH_PRIVATE_KEY
# ssh setup
RUN mkdir /root/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" >> /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa
@zynaxsoft
zynaxsoft / Slack_solarized_themes
Created February 26, 2020 07:39 — forked from mgreensmith/Slack_solarized_themes
My Solarized themes for Slack
Solarized
#FDF6E3,#EEE8D5,#93A1A1,#FDF6E3,#EEE8D5,#657B83,#2AA198,#DC322F
Solarized Dark
#073642,#002B36,#657B83,#FDF6E3,#657B83,#FDF6E3,#2AA198,#DC322F
@zynaxsoft
zynaxsoft / vimium.css
Last active February 26, 2020 06:34
Vimium solarized dark
div > .vimiumHintMarker {
/* linkhint boxes */
background: #fdf6e3;
border: 1px solid #585858;
}
div > .vimiumHintMarker span {
/* linkhint text */
color: #657b83;
font-weight: 600;