Skip to content

Instantly share code, notes, and snippets.

View shahriar-shojib's full-sized avatar

Shahriar Shojib shahriar-shojib

View GitHub Profile
@shahriar-shojib
shahriar-shojib / timezones.json
Created January 4, 2022 06:08
list of all timezones and their offsets
[
{
"timezone": "Africa/Abidjan",
"offset": "+00:00"
},
{
"timezone": "Africa/Accra",
"offset": "+00:00"
},
{
@shahriar-shojib
shahriar-shojib / center_a_fucking_div.html
Created November 28, 2020 17:36
How to center a fucking div in bootstrap
<div class="container">
<div class="row">
<div style="margin: 0 auto; min-height: 100vh; min-width: 100%;" class="d-flex align-items-center justify-content-center">
<p> this is a fucking centered item</p>
</div>
</div>
</div>
@shahriar-shojib
shahriar-shojib / request.js
Last active November 11, 2020 19:24
Javascript network request helper functions that I almost use all the time
const fetch = require('node-fetch');
function get(url, headers = {}) {
return fetch(url, {
method: 'GET',
headers,
}).then((r) => r.json());
}
async function post(url, payload, headers = {}) {
@shahriar-shojib
shahriar-shojib / paperfly.js
Last active December 17, 2020 16:53
PaperFly Courier Delivery Tracking API [Bangladesh]
//if you're using node.js uncomment below line and run "npm install node-fetch"
// const fetch = require('node-fetch')
async function paperfly (id, number) {
const res = await fetch('http://paperfly.com.bd/trackerapi.php', {
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
body: `orderid=${id}&phone=${number}`,
method: 'POST'
@shahriar-shojib
shahriar-shojib / storage.js
Last active June 17, 2020 21:24
Easy Access to chrome localStorage API for extensions
class Storage {
set(object) {
return new Promise((resolve, reject) => {
try {
chrome.storage.local.set(object, resolve);
} catch (e) {
reject(e);
}
});
}