This file contains hidden or 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
| wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip | |
| unzip /tmp/YaHei.Consolas.1.12.zip | |
| sudo mkdir -p /usr/share/fonts/consolas | |
| sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/ | |
| sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf | |
| cd /usr/share/fonts/consolas | |
| sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # query will onlny be explained, not executed | |
| mysql --defaults-extra-file=$HOME/.mysql-credentials.cnf 2>/dev/null -Dworld -E -t<<EOF | perl -000 -nlE '/(?<=EXPLAIN:)(.*)/ms && say $1' | jq | |
| EXPLAIN FORMAT=JSON SELECT * FROM city WHERE name = 'London'; | |
| EOF | |
| # /* expected result: | |
| # { | |
| # "query_block": { |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| mysql -u root -psecret -Dworld 2>/dev/null -E -t<<EOF | |
| SELECT * | |
| FROM city | |
| WHERE NAME = 'amsterdam'; | |
| EOF | |
| # /* expected result -- in vertical format */: |
This file contains hidden or 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
| <style> | |
| .myimagediv { | |
| width: 100%; | |
| } | |
| /* .myimage { | |
| filter: invert(14%) sepia(95%) saturate(6069%) hue-rotate(360deg) brightness(108%) contrast(117%); | |
| } | |
| */ | |
| </style> | |
| <div class="myimagediv"> |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # pip install crossrefapi | |
| from crossref.restful import Works | |
| import requests | |
| """ | |
| Simple client for CrossRef DOI content negotiation | |
| Tries to resolve a given DOI with CrossRef API. | |
| If it fails (e.g. DOI is not minted by the CrossRef agency), |
This file contains hidden or 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
| #!/usr/bin/perl | |
| # Convert \u1234 sequences (e.g. from Wikipedia) | |
| # to characters the terminal can display. | |
| # | |
| # example call: | |
| # curl -sL -H "Accept: text/turtle" "http://dbpedia.org/resource/Pudding" | uni2utf8.pl | |
| use strict; | |
| use warnings; |
This file contains hidden or 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
| // Node.js CheatSheet. | |
| // Credit: | |
| // forked from Github gist: devmoreno/CheatCheat.js | |
| // source URL: https://gist.github.com/devmoreno/f8db88351bc10e2a82e02dc0b06e68dd | |
| // Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
| // Download: http://nodejs.org/download/ | |
| // More: http://nodejs.org/api/all.html |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # create an SSH Tunnel to a Windows Remote Desktop machine via a sshd-jumpbox | |
| # with SSH, local port fortwarding, and xfreerdp/rdesktop. | |
| # | |
| # last lines (xdotool ...) are optional | |
| # they will open new gnome-terminal windows | |
| # | |
| # recommended step before | |
| # ssh-agent add some-privatekey | |
| # |
This file contains hidden or 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
| alias ls='exa --classify --across' | |
| alias l='exa --classify --oneline' | |
| alias ll='exa --classify --long --group' | |
| alias llg='exa --classify --long --grid --group' | |
| alias tree='exa --classify --tree' | |
| alias lrt='exa --classify --long --group --sort newest' | |
| # When --long --grid are used at the same time, --grid will only apply if the | |
| # resulting output will be at least EXA_GRID_ROWS long. | |
| export EXA_GRID_ROWS=3 |
This file contains hidden or 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
| @mixin checkerboard($size, $base, $accent: rgba(0,0,0, 0.26)) { | |
| background: $base; | |
| background-image: linear-gradient( | |
| 45deg, | |
| $accent 25%, | |
| transparent 0, | |
| transparent 75%, $accent 0 | |
| ), | |
| linear-gradient( | |
| 45deg, |