This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conky.config = { | |
update_interval = 1, | |
cpu_avg_samples = 2, | |
net_avg_samples = 2, | |
out_to_console = false, | |
override_utf8_locale = true, | |
double_buffer = true, | |
no_buffers = true, | |
text_buffer_size = 32768, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Append into ~/.ssh/config | |
Host gitlab.com | |
User git | |
Hostname gitlab.com | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/id_rsa | |
ProxyCommand /bin/nc -x 127.0.0.1:9050 %h %p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Requirements: | |
* - Node v10 | |
* - punycode.js | |
*/ | |
const request = require('request'); | |
const punycode = require('punycode'); | |
const tldDbUrl = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from: https://serverfault.com/a/646116 | |
sudo apt-get install `grep Purge /var/log/apt/history.log | tail -1 | sed -e 's|Purge: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import makedirs | |
from os.path import join, basename | |
from sys import argv | |
from nanohttp import ( | |
RestController, | |
Static, | |
html, | |
context, | |
quickstart, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div :class="classes"> | |
<label>{{ label }}</label> | |
<div class="input-group__input"> | |
<span | |
v-if="prefix" | |
class="input-group--text-field__prefix" | |
v-text="prefix" | |
/> | |
<the-mask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# File: .git/hooks/post-commit | |
# source: https://coderwall.com/p/mk18zq/automatic-git-version-tagging-for-npm-modules | |
version=`git diff HEAD^..HEAD -- "$(git rev-parse --show-toplevel)"/package.json | grep '^\+.*version' | sed -s 's/[^0-9\.]//g'` | |
if [ "$version" != "" ]; then | |
git tag -a "v$version" -m "`git log -1 --format=%s`" | |
echo "Created a new tag, v$version" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Problem: When user click on a link that refers to current path, | |
nothing happen. in vue-router logic, same path must ignore. | |
Expected: As browsers UX on old-fashion websites, user expects | |
something happen when click on a link, like refresh the current | |
route. | |
Solution: We hack the vue-router push method | |
(thanks to vue-router clean code) to append a query-string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numberingSystems = { | |
arab: '٠١٢٣٤٥٦٧٨٩', | |
arabext: '۰۱۲۳۴۵۶۷۸۹', | |
bali: '᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙', | |
beng: '০১২৩৪৫৬৭৮৯', | |
deva: '०१२३४५६७८९', | |
fullwide: '0123456789', | |
gujr: '૦૧૨૩૪૫૬૭૮૯', | |
guru: '੦੧੨੩੪੫੬੭੮੯', | |
hanidec: '〇一二三四五六七八九', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to run? | |
# sudo bash ./setup-postgres.sh | |
# Install | |
apt install -y postgresql; | |
# Set default password "postgres" for postgres user | |
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"; | |
# Allow all type of connection with md5 authentication |