Start debugserver:
tty0 # debugserver localhost:8000 main
Start tracing:
tty1 $ lldb
tty1 (lldb) command script import trace.py
Start debugserver:
tty0 # debugserver localhost:8000 main
Start tracing:
tty1 $ lldb
tty1 (lldb) command script import trace.py
/** | |
* 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])); |
0x8545
: Original 84
-> 85
0x08FF19
: Original 75
-> EB
0x1932C7
: Original 75
-> 74
(remove UNREGISTERED in title bar, so no need to use a license)#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# From https://unix.stackexchange.com/a/18631/56290 | |
# Rotate even pages by 180 degrees, don't rotate odd pages. | |
pdftk A=infile.pdf shuffle Aoddnorth Aevensouth output outfile.pdf |
function uneval(o) { | |
switch (typeof o) { | |
case "undefined": return "(void 0)"; | |
case "boolean": return String(o); | |
case "number": return String(o); | |
case "string": return `"${o.replace(/\W/gi, function(_) { return `\\u${(0x10000 + _.charCodeAt(0)).toString(16).slice(1)}` })}"`; | |
case "function": return `(${o.toString()})`; | |
case "object": | |
if (o == null) return "null"; | |
let ret, type = Object.prototype.toString.call(o).match(/\[object (.+)\]/); |
I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.
But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.
Svelte is a language.
Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?
A few projects that have answered this question:
Download and Install Emscripten
/home/user
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout main
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
# I used this shell.nix to build LineageOS 13.0 for my maguro (Samsung Galaxy Nexus GSM) phone | |
# The build instructions for normal Linuxes are here: https://wiki.lineageos.org/devices/maguro/build | |
# For NixOS, follow those instructions but skip anything related to installing packages | |
# Detailed instructions: | |
# cd into an empty directory of your choice | |
# copy this file there | |
# in nix-shell: | |
# $ repo init -u https://github.com/LineageOS/android.git -b cm-13.0 | |
# $ repo sync | |
# $ source build/envsetup.sh |
#!/bin/env python3 | |
import libtorrent as lt | |
with open("/path/to/file.torrent", "rb") as f: | |
e = lt.bdecode(f.read()) | |
info = lt.torrent_info(e) | |
print(info.num_pieces(), 'pieces') | |
files = info.files() | |
def humanize(size_bytes): |
from __future__ import print_function | |
import struct | |
import gdb | |
def log(): | |
# Get the inferior. | |
try: |