Skip to content

Instantly share code, notes, and snippets.

@amit08255
amit08255 / nexus_prisma_cheatsheet.md
Last active June 4, 2024 06:19
Nexus + Prisma CheatSheet

Nexus + Prisma CheatSheet

Creating model in Prisma

First create generator and datasource entry in your .prisma file like below:

generator client {
  provider = "prisma-client-js"
}
@amit08255
amit08255 / powershell.md
Created June 4, 2022 10:22
Resync windows time powershell

Type below commands in admin powershell:

w32tm /unregister

w32tm /register

net stop w32time

net start w32time
@amit08255
amit08255 / intercept.js
Created June 16, 2022 06:26 — forked from suprememoocow/intercept.js
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;
@amit08255
amit08255 / background.js
Created June 22, 2022 05:35 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@amit08255
amit08255 / README.md
Last active June 29, 2022 18:09
Chrome extension inject javascript

Chrome Extension Inject JavaScript to Website

Simple example to inject console panel to any website. It injects CSS and JavaScript to the website.

Example: Manifest.json

{
  "name": "Athena",
  "description": "Athena, a tool for improving communication between developers and testers.",
@amit08255
amit08255 / axios-cache-interceptors.js
Created July 13, 2022 17:49 — forked from javisperez/interceptors.js
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {
@amit08255
amit08255 / rarreg.key
Created August 1, 2022 23:21 — forked from MuhammadSaim/rarreg.key
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@amit08255
amit08255 / cheatsheet.md
Last active June 20, 2023 17:15
DigitalOcean Cheatsheet

DigitalOcean Cheatsheet

Building Node.js Application

To build Node.js without interrupting run below command:

nohup yarn build &
@amit08255
amit08255 / intercept-function.js
Created August 18, 2022 10:29 — forked from tilmanschweitzer/intercept-function.js
Function to intercept functions calls even to nativ functions.
function interceptFunction (object, fnName, options) {
var noop = function () {};
var fnToWrap = object[fnName];
var before = options.before || noop;
var after = options.after || noop;
object[fnName] = function () {
before.apply(this, arguments);
var result = fnToWrap.apply(this, arguments);
after.apply(this, arguments);
@amit08255
amit08255 / debug-events.js
Created August 18, 2022 12:28 — forked from alessioalex/debug-events.js
intercept *.addEventListener for debugging
// http://stackoverflow.com/questions/4787698/failure-to-override-elements-addeventlistener-in-firefox
(function() {
Error.stackTraceLimit = Infinity;
var _interfaces = Object.getOwnPropertyNames(window).filter(function(i) {
return /^HTML/.test(i);
}).map(function(i) {
return window[i];
});