Skip to content

Instantly share code, notes, and snippets.

View benjamingwynn's full-sized avatar
💡

Benjamin Gwynn benjamingwynn

💡
  • United Kingdom
  • 07:39 (UTC)
View GitHub Profile
@benjamingwynn
benjamingwynn / README.md
Created July 11, 2024 23:07 — forked from Gadgetoid/README.md
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.

// copy current children except a certain child while keeping all refs - a pain in the ass.
let i = oldParent.childNodes.length - 1
for (; i >= 0; i -= 1) {
const c = oldParent.childNodes[i]
// whatever, your condition here
if (c.nodeName.toLowerCase() !== "slot") {
newParent.appendChild(c)
@benjamingwynn
benjamingwynn / gist:3708951
Created September 12, 2012 18:38 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
BUILDDATE=$(date +"%Y%m%d")
scp -P 2222 out/target/product/primoc/"cm-9-"$BUILDDATE"-UNOFFICIAL-primoc.zip" [email protected]:public_html/primoc/CM9/nightlies/"cm-9-"$BUILDDATE"-UNOFFICIAL-primoc.zip"
exit