Skip to content

Instantly share code, notes, and snippets.

@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active May 9, 2024 08:26
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@cdaringe
cdaringe / pnpm-patch-package.js
Created April 13, 2022 18:28
pnpm-patch-package.js
/**
* @description
* Support patch-package in pnpm projects.
*
* `pnpm` can be tricky to use with patch-package. To minimize friction creating patches,
* this script helps automate patching by using npm and a temp workspace to generate
* patch files.
*
* @usage
* 0. ensure the dependencies of interest are top level dependencies/devDependencies (no patching transitive deps)
@milahu
milahu / index.html
Last active October 5, 2020 15:58
performance of different loop types #jsbench #jsperf (http://jsbench.github.io/#6f65c587af9277325bcda0e69ba44d5f) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>performance of different loop types #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jaames
jaames / fancy-css-links.md
Last active April 13, 2022 09:20
Fancy CSS link underlines with inline SVGs (plus embedded animations!)
@mjpieters
mjpieters / # Sourcemap processing in Python.md
Last active December 15, 2023 11:32
Python sourcemap parsing

Sourcemap processing in Python

This gist contains two Python modules:

  • sourcemap: a module to parse and generate JavaScript source maps
  • base64vlq: code to decode and encode base64 VLQ sequences, an encoding used in source maps.

License

The code is licensed under the terms of the MIT license, included in the gist.

@timw4mail
timw4mail / json-parser.js
Last active January 19, 2021 12:49
Pure JS JSON Parser
/**
* Pure JS JSON Parser
*
* @see https://lihautan.com/json-parser-with-javascript/
* @param {string} str
*/
function parseJSON(str) {
let i = 0;
const value = parseValue();
@jaroslav-kubicek
jaroslav-kubicek / codeshift-remove-alias.js
Last active November 30, 2022 17:51
Codeshift script to remove import alias
const path = require("path");
function replacePathAlias(currentFilePath, importPath, pathMap) {
// if windows env, convert backslashes to "/" first
console.log(currentFilePath)
currentFilePath = path.posix.join(...currentFilePath.split(path.sep));
const regex = createRegex(pathMap);
return importPath.replace(regex, replacer);
@edro15
edro15 / CompileNetBeansProjectANT.md
Created November 19, 2019 10:48
[How To] Compile a Java NetBeans project with Apache Ant

Problem

You need to modify code of a Java NetBeans project but you neither have or want to install that IDE in order to re-compile it.

Solution

Use Apache Ant to compile your Java code.

Instructions

  • Create a folder (e.g. lib) in your project, at the same level of nbproject, and save all dependencies (jars) there.
@nkaretnikov
nkaretnikov / README.md
Created September 27, 2019 15:08
lldb trace

Start debugserver:

tty0 # debugserver localhost:8000 main

Start tracing:

tty1 $ lldb
tty1 (lldb) command script import trace.py
@boukeversteegh
boukeversteegh / sortArrays.js
Last active February 15, 2023 09:21
Sorting multiple arrays in Javascript
/**
* Sorts all arrays together with the first. Pass either a list of arrays, or a map. Any key is accepted.
* Array|Object arrays [sortableArray, ...otherArrays]; {sortableArray: [], secondaryArray: [], ...}
* Function comparator(?,?) -> int optional compareFunction, compatible with Array.sort(compareFunction)
*/
function sortArrays(arrays, comparator = (a, b) => (a < b) ? -1 : (a > b) ? 1 : 0) {
let arrayKeys = Object.keys(arrays);
let sortableArray = Object.values(arrays)[0];
let indexes = Object.keys(sortableArray);
let sortedIndexes = indexes.sort((a, b) => comparator(sortableArray[a], sortableArray[b]));