Skip to content

Instantly share code, notes, and snippets.

View rankun203's full-sized avatar
🔨
building things

Kun R rankun203

🔨
building things
View GitHub Profile
@rankun203
rankun203 / currencies.js
Last active November 29, 2017 03:39
Currencies helper
// Data is from http://www.xe.com/symbols.php
const currencies = {
ALL: { code: 'ALL', fontCode: 'Lek' },
AFN: { code: 'AFN', fontCode: '؋' },
ARS: { code: 'ARS', fontCode: '$' },
AWG: { code: 'AWG', fontCode: 'ƒ' },
AUD: { code: 'AUD', fontCode: '$' },
AZN: { code: 'AZN', fontCode: '₼' },
BSD: { code: 'BSD', fontCode: '$' },
BBD: { code: 'BBD', fontCode: '$' },

Keybase proof

I hereby claim:

  • I am rankun203 on github.
  • I am kun (https://keybase.io/kun) on keybase.
  • I have a public key ASCChicqQHhrP2jOFa7k8AQ-n8Kn01JNjJoMIds1y2FTqwo

To claim this, I am signing this object:

@rankun203
rankun203 / backup-docker.sh
Created April 4, 2017 01:44
Backup data to pwd/tar.gz from a container.
#!/usr/bin/env bash
#
# $1: backup filename.
# $2: backup target dir.
# $3: backup target volumes
if [[ "$1" = "-h" ]]
then
echo '$1: backup filename.'
echo '$2: backup target dir.'
@rankun203
rankun203 / index.html
Last active January 2, 2017 15:23
Use service worker to quickly fail non accessible URLs.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Service Worker test</title>
<script>
navigator.serviceWorker.getRegistration().then(function (registration) {
if (!registration || !navigator.serviceWorker.controller) {
navigator.serviceWorker.register('./sw.js').then(function () {
console.log('Service worker registered, reloading the page');
@rankun203
rankun203 / font-face-observer.html
Last active December 14, 2016 10:27
Professional Web Typography Notes
<!DOCTYPE html>
<!--#if expr="$HTTP_COOKIE=/fonts\-loaded\=true/" -->
<html lang="en" class="fonts-loaded">
<!--#else -->
<html lang="en">
<!--#endif -->
<head>
<meta charset="utf-8">
<title></title>
@rankun203
rankun203 / css-limit-lines.css
Last active December 14, 2016 10:20
css-limit-lines.css
/* mixin for multiline */
@mixin multiLineEllipsis($lineHeight: 1.2em, $lineCount: 1, $bgColor: white){
overflow: hidden;
position: relative;
line-height: $lineHeight;
max-height: $lineHeight * $lineCount;
text-align: justify;
margin-right: -1em;
padding-right: 1em;
&:before {
@rankun203
rankun203 / docker-compose.yml
Last active January 9, 2017 03:19
Docker compose file for mysql web and update-db scripts. https://github.com/abh/ntppool/blob/master/docker-compose.yml
version: '2'
services:
mysql:
image: mariadb:10.0
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ntppool
git config --global http.proxy 'http://localhost:8123'
@rankun203
rankun203 / animate-height.css
Created September 26, 2016 15:04
Make height animation from height to auto.
blockquote:hover {
height: auto;
max-height: 1500px;
overflow: visible;
background: rgba(0, 0, 0, 0.03);
}
blockquote {
max-height: 100px;
overflow: hidden;
cursor: pointer;
@rankun203
rankun203 / style.css
Last active September 13, 2016 01:17
苹果毛玻璃特效
#main-nav {
backdrop-filter: saturate(180%) blur(20px);
}