Skip to content

Instantly share code, notes, and snippets.

Fazlur Rahman fazlurr

Block or report user

Report or block fazlurr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hexToRgb.js
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),
View decode.js
* Decode URI Component safe to use with single %
* @param {string} s String to Decode
* @return {string} Decoded Result
* @see
export const decodeURIComponentSafe = (s) => {
if (!s) return s;
View print.js
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 ="","", 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
fazlurr /
Created May 22, 2019 — forked from eladnava/
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
# Make sure to:
# 1) Name this file `` 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
# 7) Test it out via ./
fazlurr /
Created May 22, 2019 — forked from caraboides/
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
set -e
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
/usr/bin/aws s3 mb $S3PATH
View htmlValidator.js
var checkHTML = function(html) {
var doc = document.createElement('div');
doc.innerHTML = html;
return ( doc.innerHTML === html );

Font Face

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);
fazlurr /
Created Apr 10, 2019 — forked from bentinata/
  1. Jadilah pengguna yang berguna.

  2. 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.

  3. Kaji ulang setiap pesan yang akan dibuat.
    Pesan singkat dan langsung pada intinya.

View query
$project: {
hour: {
$hour: "$processing_at"
}, {
$match: {
hour: {
"$in": [18]
You can’t perform that action at this time.