Skip to content

Instantly share code, notes, and snippets.

View fmunirdev's full-sized avatar
🎯
Focusing

Fahad Munir fmunirdev

🎯
Focusing
View GitHub Profile
@fmunirdev
fmunirdev / server4spa.py
Last active September 17, 2022 11:56 — forked from iktakahiro/server4spa.py
Python3 http.server for Single Page Application
#!/usr/bin/env python
# Inspired by https://gist.github.com/jtangelder/e445e9a7f5e31c220be6
# Python3 http.server for Single Page Application
import os
import socketserver
import multiprocessing as mp
import re
import urllib.parse
@fmunirdev
fmunirdev / .settings.json
Last active December 28, 2019 02:05 — forked from robfrawley/.settings.json
Global Installation of Jetbrains Toolbox
{
"privacy_policy": {
"eua_accepted_version": "1.2"
},
"install_location": "/opt/JetBrains/Toolbox",
"shell_scripts": {
"enabled": true,
"location": "/opt/JetBrains/Toolbox/bin"
},
"statistics": {
@fmunirdev
fmunirdev / run_repast_container.sh
Last active December 26, 2019 18:48
Shell script to build and run repastnode's docker container.
#!/bin/sh
REPAST_SCRIPT='repastmulti.sh'
# Verify REPAST_SCRIPT script
[ ! -f $REPAST_SCRIPT ] &&\
echo "repastmulti script '$REPAST_SCRIPT' not found" &&\
exit 1
sed -i '7cINSTALLATION=/EMS/repast' $REPAST_SCRIPT
@fmunirdev
fmunirdev / c_cpp_properties.json
Last active October 20, 2019 21:17
Using Mingw-w64 in VS Code
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**", "${vcpkgRoot}/x86-windows/include"
],
"defines": [
"_DEBUG",
"UNICODE",
@fmunirdev
fmunirdev / MainActivity.java
Last active June 1, 2019 11:55
Android: Restrict Google Sign In to certain emails with domain
private void handleSignInResult(GoogleSignInResult result) {
Log.d(TAG, "handleSignInResult:" + result.isSuccess());
if (result.isSuccess()) {
// Signed in successfully.
GoogleSignInAccount acct = result.getSignInAccount();
String email = acct.getEmail();
String[] split = s.split("@");
String domain = split[1]; //This Will Give You The Domain After '@'
if(domain.equals("companyname.com"))
{
@fmunirdev
fmunirdev / DocTrackingDB.sql
Created April 18, 2019 21:09
Setting database queries for Document Tracking System
CREATE TABLE receiving(
receiving_date DATE NOT NULL,
diary_no INT NOT NULL,
no_of_letter VARCHAR(40) NOT NULL,
creation_date DATE NOT NULL,
file_no VARCHAR(40),
-- original_address VARCHAR(40),
from_dpt VARCHAR(40) NOT NULL,
to_dpt VARCHAR(40) NOT NULL,
subject VARCHAR(255) NOT NULL,
@fmunirdev
fmunirdev / MessAttendance.js
Last active April 9, 2019 13:08
UOG Boys Hostel - Mess Attendance Email Template
<script>
function customCalendar(year, month) {
month--;
let d = new Date(year, month);
let firstDay = d.getDay();
let date = 1, dateIter = 1;
var table = "<table>";
table += "<tr><th colspan=14>" + d.toLocaleString('en-us', { month: 'long' }) + " " + d.getFullYear() + "</th></tr>";
table += "<tr>";