Skip to content

Instantly share code, notes, and snippets.

View ShadowShahriar's full-sized avatar
We don't need to worry, cuz when we fall, we know how to land

S. Shahriar ShadowShahriar

We don't need to worry, cuz when we fall, we know how to land
View GitHub Profile
@ShadowShahriar
ShadowShahriar / srtf.cpp
Created October 7, 2025 09:12 — forked from shahrilnet/srtf.cpp
Naive implementation of SRTF algorithm (Short Remaining TIme First) using C++
#include <iostream>
using namespace std;
int SIZE_STRUCT;
int choose_process(struct process Process[], int running[], int size_running);
int get_total_burst_time(struct process Process[]);
int check_if_exist(int running[], int size_running, int check);
void add_running_process(struct process Process[], int running[], int &size_running, int i);
@ShadowShahriar
ShadowShahriar / map.js
Created March 5, 2022 18:31 — forked from xposedbones/map.js
Javascript Map range of number to another range
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
@ShadowShahriar
ShadowShahriar / README.md
Created January 19, 2022 13:02 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@ShadowShahriar
ShadowShahriar / twitter.sh
Created January 4, 2022 21:42 — forked from sophia-ooo/twitter.sh
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@ShadowShahriar
ShadowShahriar / index.html
Created November 17, 2021 16:06 — forked from StickyCube/index.html
Electron click through transparency example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test App</title>
</head>
<style>
html, body {
height: 100%;
@ShadowShahriar
ShadowShahriar / gulpfile.js
Created September 22, 2021 19:22 — forked from razbomi/gulpfile.js
Gulp pipe function
'use strict';
var gulp = require('gulp');
var through = require('through2');
// https://gulp.readme.io/docs
gulp.task('default', () => {
gulp.src('src/**/*')
.pipe(pipeFunction())
.pipe(gulp.dest('dist'))
@ShadowShahriar
ShadowShahriar / package.json
Created September 2, 2021 04:10 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@ShadowShahriar
ShadowShahriar / .babelrc
Created September 1, 2021 20:21 — forked from c9s/.babelrc
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io

Setting up Webpack for any Typescript project from Scratch

Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.

You will learn below things:

  1. ✅Create a Typescript node.js project.
  2. ✅Install Dependencies with webpack & typescripts.
  3. ✅Use Webpack CLI to crate webpack.config.js file and modify webpack.config.js based on our need.