Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Huy Tr. huytd

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 customize.material-dark-theme.md

;; Automatically generated
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(anzu-cons-mode-line-p nil)
@huytd
huytd / emacs.init.el
Last active Apr 17, 2019
Emacs config with no Evil
View emacs.init.el
;; Package configs
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; Bootstrap `use-package`
(unless (package-installed-p 'use-package)
@huytd
huytd / slack-arc-dark.css
Created Apr 17, 2019
Arc dark theme for Slack, with Threads screen fix
View slack-arc-dark.css
body { background: #404552; color: #d3dae3; }
a { color: #90939b; }
a:link, a:visited { color: #90939b; }
a:hover, a:active, a:focus { color: #90939b; }
hr { border-bottom: 1px solid #454c5c; border-top: 1px solid #404552; }
h1, h2, h3, h4 { color: #d3dae3; }
h1 a { color: #d3dae3; }
h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #d3dae3; }
.bordered { border: 1px solid #2a2f39; }
.top_border { border-top: 1px solid #2a2f39; }
@huytd
huytd / ripgrep-in-emacs.md
Created Nov 16, 2018 — forked from pesterhazy/ripgrep-in-emacs.md
Using ripgrep in Emacs using helm-ag (Spacemacs)
View ripgrep-in-emacs.md

Why

Ripgrep is a fast search tool like grep. It's mostly a drop-in replacement for ag, also know as the Silver Searcher.

helm-ag is a fantastic package for Emacs that allows you to display search results in a buffer. You can also jump to locations of matches. Despite the name, helm-ag works with ripgrep (rg) as well as with ag.

How

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"
]
@huytd
huytd / android_game.java
Last active Mar 28, 2019
Simple game engine using Canvas for Android - using for quick prototype or simple games
View android_game.java
package com.gamarist.momoney;
import android.os.Bundle;
import android.R.integer;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
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]
@huytd
huytd / .gitconfig
Created Aug 4, 2016
Use neovim as diff tool
View .gitconfig
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
You can’t perform that action at this time.