Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Huy Tr. huytd

💭
I may be slow to respond.
Block or report user

Report or block huytd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View slack-style-join-left-message.js
const Join = 1;
const Leave = -1;
const JoinedAndLeft = 2;
const Rejoined = -2;
const toStatus = n => {
switch (n) {
case Join: return 'joined';
case Leave: return 'left';
case JoinedAndLeft: return 'joined and left';
@huytd
huytd / karabiner.json
Last active Mar 29, 2019
Custom modificator for Karabiner
View karabiner.json
{
"description":"Ctrl + G as Escape except Emacs",
"manipulators":[
{
"from":{
"key_code":"g",
"modifiers":{
"mandatory":[
"control"
]
View org-journal-list.el
(defun read-journal (path)
(with-temp-buffer
(insert-file-contents (concat "~/notes/journal/" path))
(split-string (buffer-string) "\n" t)))
(defun read-first-three-lines (list)
(cond ((>= (length list) 4) (subseq list 1 3))
((>= (length list) 1) (nthcdr 1 list))
(t list)))
View polybar.config
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[settings]
View keyboard-prototype.c
/* Snacky2x2 Keyboard Firmware
By @huydotnet
You must select Keyboard from the "Tools > USB Type" menu
Change Log:
- v2: Fixes debounce problem by adding key state checking.
Reset the debounce timer when key state changed.
- v3: Snap the processing to every 1 millisecond.
- v4: Implement a different debouncing algorithm.
REGISTER_DELAY is a time before key can be registered
at each frame. REPEAT_DELAY is a time before a new frame
View attractions-in-sf.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View route-data.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huytd
huytd / ffmpeg-compress-mp4
Created Dec 18, 2018 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
View ffmpeg-compress-mp4
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
View four_key_firmware.c
/* Snacky2x2 Keyboard Firmware
By @huydotnet
You must select Keyboard from the "Tools > USB Type" menu
*/
#include <Keyboard.h>
const byte ROWS = 2;
const byte COLS = 2;
View base16-ocean-mono.vim
" base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
" Ocean scheme by Chris Kempson (http://chriskempson.com)
" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
" let g:base16_shell_path=base16-builder/output/shell/
if !has('gui_running')
if exists("g:base16_shell_path")
You can’t perform that action at this time.