Skip to content

Instantly share code, notes, and snippets.

@DanielTimLee
DanielTimLee / prototype.py
Created July 24, 2018 16:16 — forked from pazdera/prototype.py
Example of `prototype' design pattern in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `prototype' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@DanielTimLee
DanielTimLee / gist:f432b7d362e948fa06a7a6a0b3740b74
Created September 19, 2019 15:20 — forked from dtroyer/gist:a065b77ebe0443659898
Test traps, errexit, errtrace
#!/bin/bash
# Do some errexit testing
# 0 - test success
# 1 - test simple fail
# 2 - test function fail
#
# in function
# N errexit errtrace pass?
@DanielTimLee
DanielTimLee / vimium-emacs.md
Created December 6, 2019 12:52 — forked from dmgerman/vimium-emacs.md
Emacs-Style Key Bindings for Vimium

My Vimium Key Bindings (Emacs-Style)

This is a full set of key bindings (as of Vimium v1.45); covering all Vimium functionality. I have tried to map all Vimium functionality to comparable Emacs functionality (whenever possible). In cases where there is no equivalent, those commands are prefixed by <c-g> (indicating <c-g>oogle Chrome; and because <c-g> does not conflict with other Emacs shortcuts at all).

Commented Shortcuts: There are a few Emacs-style shortcuts that are simply not possible in Vimium. All of my shortcuts (including those which were not possible; i.e. where I used a decent alternative) have been commented below. This should help to clarify my rationale.

_Compatibility: All of these shortcuts were tested on Mac OS X (Mavericks). Please note that all of my shortcuts operate under the assumption that your Emacs Meta key is the Alt/Option key. This really was my only choice, because the key is already used in Chrome for shortcuts that c

@DanielTimLee
DanielTimLee / README.md
Created January 13, 2020 08:02 — forked from fntlnz/README.md
Seccomp bpf filter example

Seccomp BPF filter example

Use bpf programs as filters for seccomp, the one in the example will block all the write syscalls after it's loaded.

Usage

Compile it with just

gcc main.c
@DanielTimLee
DanielTimLee / pkg-config-guide.md
Created January 18, 2020 21:49 — forked from lethee/pkg-config-guide.md
Guide to pkg-config 한글 번역
@DanielTimLee
DanielTimLee / qemu-s390x-debian-rules.patch
Created May 14, 2020 13:17 — forked from paboldin/qemu-s390x-debian-rules.patch
qemu-system-s390x emulator on Ubuntu how-to
--- qemu-2.5+dfsg/debian/rules 2016-04-19 18:48:46.000000000 +0300
+++ qemu-2.5+dfsg.new/debian/rules 2017-07-25 23:38:18.882758751 +0300
@@ -132,9 +132,13 @@ ifeq ($(enable_linux_user),enable)
$(MAKE) -C user-static-build V=${V} $(foreach t,${user_targets},subdir-${t}-linux-user)
endif
-ifneq ($(filter $(DEB_HOST_ARCH),s390 s390x),)
- $(MAKE) -C qemu-build/pc-bios/s390-ccw V=${V}
-endif
+#ifneq ($(filter $(DEB_HOST_ARCH),s390 s390x),)
@DanielTimLee
DanielTimLee / tmux-notify.pl
Created November 29, 2021 11:01 — forked from basilfx/tmux-notify.pl
Irssi and tmux-notify
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
use Irssi;
# Script info
$VERSION = '0.1';
%IRSSI = (
authors => 'Bas Stottelaar',