Skip to content

Instantly share code, notes, and snippets.

View Narga's full-sized avatar

Nguyễn Đình Quân Narga

View GitHub Profile
@w0ng
w0ng / tlp
Last active August 29, 2015 13:55
/etc/defualt/tlp
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable them
# Set to 0 to disable/1 to enable TLP
TLP_ENABLE=1
# Seconds laptop mode has to to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
@anselmh
anselmh / load-webfonts-async.js
Created March 11, 2013 11:07
This snippet loads webfonts (in this case from Google Webfonts) asynchronously. This means it does not block page load but also means it can cause FOUT.
WebFontConfig = {
google: { families: [ 'Istok+Web:400,700:latin' , 'Lora:400,700:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
certbot revoke -d your-site.com -d your-site.net
@hexchain
hexchain / 51-noto-color-emoji.conf.xml
Last active July 7, 2020 23:42
Emoji on Linux desktop. Use with aur/cairo-coloredemoji.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/conf.avail/51-noto-color-emoji.conf -->
<fontconfig>
<selectfont>
<acceptfont>
<pattern>
<patelt name="family"><string>Noto Color Emoji</string></patelt>
</pattern>
</acceptfont>
@paulrouget
paulrouget / .tmux.conf
Created January 27, 2012 17:37
Paul's configurations files
set -g default-terminal "screen-256color"
set -g status-utf8 on
bind M source-file ~/.tmux/mac.session
bind L source-file ~/.tmux/linux.session
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# THEME
set -g status-bg black
@vasilisvg
vasilisvg / more.md
Last active December 4, 2020 04:48
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.

@cfxd
cfxd / clear_jetpack_published.php
Last active February 21, 2021 18:33
Clear Jetpack's Publicized data to re-Publicize posts. See http://cfxdesign.com/how-to-re-publicize-posts-with-jetpack/
<?php
function clear_jetpack_published() {
if(empty($_REQUEST['post'])) {
wp_die(__('Invalid post ID or action'));
}
global $wpdb;
$id = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : '';
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@anhtran
anhtran / unicode_utils.py
Created April 18, 2018 05:41
Hàm số Chuyển đổi chuỗi Unicode Tổ Hợp sang Unicode Dựng Sẵn trong Python 3
def compound_unicode(unicode_str):
"""
Chuyển đổi chuỗi Unicode Tổ Hợp sang Unicode Dựng Sẵn
Edited from: `https://gist.github.com/redphx/9320735`
"""
unicode_str = unicode_str.replace("\u0065\u0309", "\u1EBB") # ẻ
unicode_str = unicode_str.replace("\u0065\u0301", "\u00E9") # é
unicode_str = unicode_str.replace("\u0065\u0300", "\u00E8") # è
unicode_str = unicode_str.replace("\u0065\u0323", "\u1EB9") # ẹ
unicode_str = unicode_str.replace("\u0065\u0303", "\u1EBD") # ẽ
@gmccreight
gmccreight / master.vim
Last active September 23, 2023 08:41
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)