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
#! /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 |
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 | |
# This script grabs selected text from X11, open it with goldendict | |
# and starts to speech | |
# You can configure a global shortkey through your desktop: | |
# on XFCE: Keyboard settings > Application Shortcuts | |
# add new one with command: bash /full/path/of/the/dictme.sh | |
### | |
# Grab selected text from X11 |
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
#! /bin/bash | |
# | |
# Personal workspace switcher | |
# author: meyt | |
# | |
# - Change directory to project path | |
# - Automatic python virtualenv activate/deactivate | |
# - Auto-complete | |
# | |
# Install |
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> | |
<StackLayout :class="classess"> | |
<FlexboxLayout | |
flexDirection="row" | |
:justifyContent="hintIsRtl ? 'flex-end' : 'flex-start'" | |
class="field-label" | |
> | |
<StackLayout | |
v-if="value_.length > 0" | |
class="wrapper" |
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
import * as app from 'tns-core-modules/application' | |
import { device } from 'tns-core-modules/platform' | |
export function hideSystemUi () { | |
if (!app.android || parseInt(device.sdkVersion) < 21) { return } | |
const androidViewPkg = android.view // eslint-disable-line no-undef | |
const View = androidViewPkg.View | |
const window = app.android.startActivity.getWindow() | |
const decorView = window.getDecorView() | |
decorView.setSystemUiVisibility( |