Skip to content

Instantly share code, notes, and snippets.

@AmesianX
AmesianX / checkout-chromium-release-branches.markdown
Created September 1, 2019 05:39 — forked from jjgod/checkout-chromium-release-branches.markdown
Steps to checkout Chromium release branches

Steps to checkout Chromium release branches

Initial setup

mkdir chromium && cd chromium
fetch --nohooks chromium --nosvn=True
gclient sync --with_branch_heads --nohooks # May not even need this.

Fetching/updating a specific release branch

@AmesianX
AmesianX / confluence-h2-restore.sh
Created June 11, 2019 07:58 — forked from AlmostGosu/confluence-h2-restore.sh
Shell script to recover corrupted Confluence h2 database
#!/bin/bash
# This script has to be run as your confluence user or root
# Create a backup of, and attempt to restore a confluence h2 internal database
# Go home.
cd ~
# Stop confluence
/opt/atlassian/confluence/bin/stop-confluence.sh
# Really though...
diff -Naur duktape/src-input/builtins.yaml duktape-ooo/src-input/builtins.yaml
--- duktape/src-input/builtins.yaml 2019-05-11 19:06:14.000000000 -0700
+++ duktape-ooo/src-input/builtins.yaml 2019-05-04 18:07:33.000000000 -0700
@@ -204,80 +204,80 @@
# This could be stripped when DUK_USE_GLOBAL_BUILTIN is disabled
# ("void 0" is the same and safer) but it's commonly used so keep.
- - key: "Object"
+ - key: "OOOObjectOOO"
value:
@AmesianX
AmesianX / hello_world.c
Created May 12, 2019 08:17 — forked from kripken/hello_world.c
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@AmesianX
AmesianX / frida-modules.py
Created March 19, 2019 20:41 — forked from corycook/frida-modules.py
Command line shortcut to enumerate modules with frida
import frida, argparse
parser = argparse.ArgumentParser(description='List modules for a process')
parser.add_argument('process_names', metavar='process name', nargs='+', help='names of processes to enumerate')
parser.add_argument('-R', dest='target', action='store_const', const=True, default=False,
help='target remote device')
try:
args = parser.parse_args()
target = frida
@AmesianX
AmesianX / enumerable.js
Created March 19, 2019 20:40 — forked from corycook/enumerable.js
Using Object.defineProperty to fake an Array-like object that can be iterated over with a for loop or Array.prototype.slice.
function Enumerable(generator, length, start) {
this.generator = generator;
this.length = length || Infinity;
this.current = start || 0;
this.index = 0;
Object.defineProperty(this, this.index, { get: this.next, configurable: true });
}
Enumerable.prototype.next = function() {
@AmesianX
AmesianX / fn.js
Created March 19, 2019 20:40 — forked from corycook/fn.js
JavaScript function type checking and overloading
function create() {
var types = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
var body = arguments[arguments.length - 1];
return function () {
if (arguments.length < types.length)
throw new Error("Argument count mismatch.");
for (var i = 0; i < types.length; i++) {
if (arguments[i].constructor != types[i] && !(arguments[i] instanceof types[i]))
throw new Error("Argument type mismatch. (" + types[i].name + ")");
@AmesianX
AmesianX / amd.js
Created March 19, 2019 20:40 — forked from corycook/amd.js
A quick implementation of AMD
(function () {
var filename = "amd.js";
var scripts = Array.prototype.slice.call(document.querySelectorAll("script[src]"));
var self = scripts.filter(function (x) { return x.getAttribute("src").indexOf(filename) > -1; })[0];
var src = self.getAttribute("src");
var root = src.substring(0, src.indexOf(filename));
var modules = {};
@AmesianX
AmesianX / debounce.js
Created March 19, 2019 20:39 — forked from corycook/debounce.js
A really simple debounce function.
function debounce(fn, ms) {
let id;
return function() {
clearTimeout(id);
id = setTimeout(() => fn.apply(this, arguments), ms);
}
}
@AmesianX
AmesianX / throttle.js
Created March 19, 2019 20:39 — forked from corycook/throttle.js
A simple throttle function.
function throttle(fn) {
let waiting = false;
return function() {
if (!waiting) {
waiting = true;
requestAnimationFrame(() => {
waiting = false;
fn.apply(this, arguments);
});
}