Skip to content

Instantly share code, notes, and snippets.

View SMUsamaShah's full-sized avatar
🎯
Focusing ... almost

Muhammad Usama SMUsamaShah

🎯
Focusing ... almost
View GitHub Profile

Keybase proof

I hereby claim:

  • I am smusamashah on github.
  • I am smusamashah (https://keybase.io/smusamashah) on keybase.
  • I have a public key whose fingerprint is B0C2 41BC 9CF6 16CE 8A6F 78AC A017 A67C 6750 F6E9

To claim this, I am signing this object:

@SMUsamaShah
SMUsamaShah / selfAdjustingTimeout.js
Created October 12, 2018 19:57
self adjusting setTimeout
setTimeout.dt = 0;
function selfAdjustingTimeout(callback, timeout, args) {
setTimeout.et = (new Date).getTime() + timeout;
let cb = () => {
setTimeout.dt = (new Date).getTime() - setTimeout.et;
callback();
};
setTimeout(cb, timeout - setTimeout.dt, args);
}
@SMUsamaShah
SMUsamaShah / List of JavaScript GUI libraries.md
Last active April 29, 2024 14:48
dat.gui alternatives to create GUI from JavaScript object

JavaScript GUI libraries

These libraries can be used to quickly create a GUI for configureable parameters using sliders, checkboxes, colors pickers etc

  1. Tweakpane https://github.com/cocopon/tweakpane Demo: https://cocopon.github.io/tweakpane/
  2. control-panel https://github.com/freeman-lab/control-panel
  3. ControlKit https://github.com/automat/controlkit.js
  4. guify https://github.com/colejd/guify Main site is down, here is the demo https://jons.website/projects/guify/index
  5. oui https://github.com/wearekuva/oui
  6. Palette.js https://github.com/lehni/palette.js
@SMUsamaShah
SMUsamaShah / TIL.md
Last active February 8, 2021 16:46
TIL

Linux list all procs with command args

ps -ef

Github url shortner

$ curl -i https://git.io 
@SMUsamaShah
SMUsamaShah / list-of-markdown-tools.md
Last active April 29, 2020 10:57
List of Markdown Tools and Utilities
## Knowledge DBs
- http://www.yacoset.com/
- https://programming-idioms.org/
- http://lambda-the-ultimate.org/
- http://www.linfo.org/
- https://programmingisterrible.com/
- http://blog.cleancoder.com - Uncle Bob Martin
## Articles
@SMUsamaShah
SMUsamaShah / Java notes.md
Last active June 14, 2020 19:18
Braindump for OCAJP, Oracle Certified Associate, Java SE 8 Programmer I

I wrote these while preparing for OCAJP exam. Most of it is in form of code with output right next to it as a comment.

Chapter 1 and 2

Classes

One java file can have multiple classes, maximum only one class can be public.

@SMUsamaShah
SMUsamaShah / filter-epic-games.js
Last active September 24, 2020 10:13
Filter Epic Game Store by Price
// open https://www.epicgames.com/store/en-US/browse?pageSize=1000
// paste in console and run
function filterEpicGames(min = 0, max = 15) {
let games = document.querySelectorAll("#dieselReactWrapper > div > div[class*='AppPage__bodyContainer'] > main > div > div > div > div > div > section > div > div > div > section > div > section > section > ul > li > a > div > div > div[class*='OfferCard__meta']");
let c = 1;
for (let i = 0; i < games.length; i++) {
let name = games[i].firstChild.innerText;
let priceText = (games[i].lastChild.lastChild.lastChild ? games[i].lastChild.lastChild.lastChild.lastChild.nodeValue : games[i].lastChild.lastChild.nodeValue);
let price = 0;