Skip to content

Instantly share code, notes, and snippets.

@floxay
floxay / get_client_version.py
Last active April 26, 2024 20:01
Get VALORANT client/build version from game executable
import pefile
def get_product_version(data: bytes) -> str:
pe = pefile.PE(data=data, fast_load=True)
pe.parse_data_directories(
directories=[pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_RESOURCE"]]
)
for file_info in pe.FileInfo:
for entry in file_info:
Cu.import("resource://gre/modules/Task.jsm")
let runTaskWhileValid = (isValid, generator) => {
Task.spawn(function* () {
const g = generator();
let value, resolved;
let done = false;
while (!done) {
try {
({ value, done }) = g.next(resolved);
@arch1t3cht
arch1t3cht / resources.md
Last active April 26, 2024 20:01
Encoding Resources

So this is supposed to be a list of encoding-related resources together with some very basic instructions. Kind of an encoding analogue to fansub.html. This is not a full guide on encoding.

Since this page is starting to get linked elsewhere, I should also make clear that it mostly comes from (a person adjacent to) the JET community. In particular, it's written primarily from the perspective of anime encoding. Still, most parts will hold up equally well for live action and other areas.

This guide may seem fairly technical. Partly this is because I have a background in pure mathematics and this is how I learned the material, but partly it's just because encoding is cursed and complicated, and you will need to learn the things listed here in order to not make stupid mistakes.

Some sections contain some longer rants about stuff, most others don't. This is almost entirely based on the mood I was in when writing them.

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const ALLOCATIONS_TREE_INDENTATION = 16; // px
const AUTO_EXPAND_DEPTH = 3; // depth
@fitzgen
fitzgen / census.js
Created July 27, 2015 22:14
record allocations for 5s -> take a census
dbg = null;
Components.utils.forceGC();
Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
Debugger = devtools.require("Debugger");
dbg = devtools.require("devtools/server/actors/utils/make-debugger")({
findDebuggees: dbg => dbg.findAllGlobals(),
shouldAddNewGlobalAsDebuggee: () => true
});
@dhh
dhh / linux-setup.sh
Last active April 26, 2024 19:59
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
var FILE = require("file");
require.paths.unshift(FILE.join(FILE.dirname(module.path),
"jsmacros/vendor/jison/lib"));
var Parser = require("jison").Parser;
require.paths.shift();
var grammar = {
lex: {
rules: [
@bgrins
bgrins / reviewers.txt
Last active April 26, 2024 19:59
hg log devtools -r 'date(-180)' --template '{desc|firstline}\n' | awk '{split($0,a,"r=");print tolower(a[2])}' | grep -v "^$" | sort | uniq -c
1 miker
1 ato for marionette, rs=mossop for rest)
5 backout
1 backout a=backout on a closed tree
1 backout on a closed tree
1 baku
1 baku,
1 baku,bgrins
86 bgrins
1 bgrins, jsantell
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 19:59
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@sannajammeh
sannajammeh / Image.astro
Last active April 26, 2024 19:55
Astro Responsive Image
---
import type { ImageMetadata, ImageTransform } from "astro";
import { getImage } from "astro:assets";
import LoadableImage from "./LoadableImage.astro";
type Props = {
src: ImageMetadata;
alt: string;
/**
* Array of screens to generate the image for i.e [320, 480, 1200]