Skip to content

Instantly share code, notes, and snippets.

View mimshins's full-sized avatar
👾
Invading Codebases

Mostafa Shamsitabar mimshins

👾
Invading Codebases
View GitHub Profile
@mrchess
mrchess / gist:1820380
Created February 13, 2012 20:57
Exposes a variable openHTTPs which keeps track of how many XMLHttpRequests you have active.
<script>
(function() {
var oldOpen = XMLHttpRequest.prototype.open;
window.openHTTPs = 0;
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
window.openHTTPs++;
this.addEventListener("readystatechange", function() {
if(this.readyState == 4) {
window.openHTTPs--;
}
@denji
denji / http-benchmark.md
Last active June 30, 2026 09:29
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active May 17, 2026 18:35
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@sanskritkm
sanskritkm / Balsamiq Mockups 3.5.17
Last active August 14, 2025 11:02
Balsamiq Mockups 3.5.17 for Desktop full license key (Tested) or Balsamiq Wireframes for Desktop
Balsamiq Wireframes for Desktop full license key free
This old name is Balsamiq Mockups now the company changing the name to Balsamiq Wireframes for Desktop insteed
HOW TO:
First download softwere here: https://balsamiq.com/wireframes/desktop/
Install and follow screen direction
Use below serial:
=====================================================================================
@jengel3
jengel3 / authentication-1.controller.ts
Last active April 23, 2024 19:26
NestJS - Implementing Access & Refresh Token Authentication
// app/modules/authentication/authentication.controller.ts
import { Body, Controller, Post } from '@nestjs/common'
import { RegisterRequest } from './requests'
import { User } from '../../modules/user'
import { UsersService } from '../users/users.service'
@sindresorhus
sindresorhus / esm-package.md
Last active July 17, 2026 01:54
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@mimshins
mimshins / linear-interpolation.ts
Created July 5, 2022 11:36
Lerp (linear interpolation), InverseLerp, and Remap functions in TypeScript
/**
* Linear interpolate on the scale given by `a` to `b`, using `t` as the point on that scale.
*/
export const lerp = (a: number, b: number, t: number) => a + t * (b - a);
/**
* Inverse Linar Interpolation, get the fraction between `a` and `b` on which `v` resides.
*/
export const inLerp = (a: number, b: number, v: number) => (v - a) / (b - a);
@mimshins
mimshins / create-animation-frames.ts
Last active June 10, 2024 20:05
Animation Loop
export type FrameTicker = (deltaTime: number) => void;
/**
* Creates smooth animation frames.
*
* @param frameTicker This callback will be called on each frame.\
* The `deltaTime` argument specifies the time elapsed between the last frame
* and the one preceding it (in milliseconds).
* @returns Returns animation frames controller.
*/
@mimshins
mimshins / resolve-throwable.ts
Last active March 20, 2025 09:14
An utility function to help resolve throwables in a declarative way.
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};