A mixin for writing @font-face rules in SASS.
Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.
@include font-face(Samplino, fonts/Samplino);
workbox.routing.registerNavigationRoute('/index.html') | |
function hexToRgb(hex) { | |
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") | |
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | |
hex = hex.replace(shorthandRegex, function(m, r, g, b) { | |
return r + r + g + g + b + b; | |
}); | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? { | |
r: parseInt(result[1], 16), |
/** | |
* Decode URI Component safe to use with single % | |
* | |
* @param {string} s String to Decode | |
* @return {string} Decoded Result | |
* | |
* @see https://stackoverflow.com/a/54310080/5627904 | |
*/ | |
export const decodeURIComponentSafe = (s) => { | |
if (!s) return s; |
function printcontent() { | |
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; | |
disp_setting+="scrollbars=yes,width=300, height=350, left=50, top=25"; | |
var content_vlue = document.getElementById("content").innerHTML; | |
var w = window.open("","", disp_setting); | |
w.document.write(content_vlue); //only part of the page to print, using jquery | |
w.document.close(); //this seems to be the thing doing the trick | |
w.focus(); | |
w.print(); | |
w.close(); |
function gen(N) { | |
return ~~(Math.random() * N) + 1; | |
} |
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
#!/bin/sh | |
set -e | |
HOST=localhost | |
DB=test-entd-products | |
COL=asimproducts | |
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
S3LATEST=$S3PATH"latest".dump.gz | |
/usr/bin/aws s3 mb $S3PATH |
var checkHTML = function(html) { | |
var doc = document.createElement('div'); | |
doc.innerHTML = html; | |
return ( doc.innerHTML === html ); | |
} |
Jadilah pengguna yang berguna.
Gunakan channel yang patut.
#general untuk kepentingan umum
#random jika ingin bercanda
#rpl atau #mppl untuk diskusi mata kuliah dan tugas terkait
#channel_kelompok untuk diskusi masing-masing kelompok.
Kaji ulang setiap pesan yang akan dibuat.
Pesan singkat dan langsung pada intinya.