Skip to content

Instantly share code, notes, and snippets.

@leonjza
leonjza / README.md
Last active April 20, 2024 09:13
Forward a remote iOS device, locally.

fwd_ios.sh

Forwards a remote iOS device, exposed via usbmuxd on Linux to a local macOS client.
The inverse (aka ssh -R) is left as an excercise to the reader, but shouldn't be too hard :)

This is basically a simple usbfluxd that only depends on socat.

install

Copy the bash script to a local file, say fwd_ios.sh and make it executable with chmod +x fwd_ios.sh.

function setInputValueAndClickButton(value) {
const inputElement = document.getElementById('order-market-input');
if (inputElement) {
inputElement.value = value;
const inputEvent = new Event('input', {
bubbles: true,
cancelable: true,
});
@ashenoy463
ashenoy463 / report_template.tex
Created January 8, 2024 13:43
Boilerplate for reports with some useful packages
\documentclass[titlepage]{article}
%\documentclass[14pt,titlepage]{extarticle}
%\usepackage[a4paper, total={6in, 8in}]{geometry}
% ===========================
%Packages
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx,tikz,pgfplots}
\usepackage{physics}
\usepackage{amsthm,amsmath,amssymb,amsfonts,mathtools}
@samthecodingman
samthecodingman / bookmarklet-gcache.js
Last active April 20, 2024 09:08
Reload the current page using Google's Web Cache [Javascript Bookmarklet] [CC-BY License]
javascript:(window.location.href.indexOf("webcache.googleusercontent.com")>-1)?alert("Error:%20You%20are%20on%20the%20cached%20version."):window.location.assign("http://webcache.googleusercontent.com/search?q=cache:"+encodeURIComponent(window.location.href.replace(/(^\w+:|^)\/\//,'')));
@galiazzi
galiazzi / Cast.php
Last active April 20, 2024 09:07
Doctrine DQL cast function
<?php
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
class Cast extends FunctionNode
{
private $expr1;
@guest271314
guest271314 / harmony.md
Last active April 20, 2024 09:01
Why I use node, deno, bun, qjs, tjs at the same time

Why I use node, deno, bun, qjs, tjs at the same time.

Winds up being a (not the) rather comprehensive JavaScript toolbox. The idea being for the modern JavaScript programmer can use all of the tools available for a given requirement, task or job, without preference for any. No external bundlers or compilers are needed. No frameworks are needed. I can use qjs or tjs for systems with minimal RAM and disk space; and when I want to use Web API's deno makes an effort to provide those interfaces. In some cases I can run the exact same code in bun, deno, and node, which provides a means to perform 1:1 testing as to performance.

There's probably a few things I am unintentionally omitting below. These are just a brief synposis. I'll update accordingly.

@dmattera
dmattera / man_page_parser.py
Created January 3, 2023 02:31
man_page_parser.py
import os
def parse_man_file(man_filepath):
with open(man_filepath, "r") as man_file:
lines = man_file.read().split("\n")
formatted_lines = []
for line in lines:
# remove Apple developer comments included on the same line and strip off trailing white space
@chrismccoy
chrismccoy / gitcheats.txt
Last active April 20, 2024 08:50
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# edit all commit messages
git rebase -i --root
# clone all your repos with gh cli tool
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone