Skip to content

Instantly share code, notes, and snippets.

@jtanx
jtanx / 0001-Add-Huawei-alt-mode-support.patch
Created December 28, 2018 13:10
usbmode huawei alt mode patch
From 7b33451b684c5c2703ee8ff9a523c8384337eaa0 Mon Sep 17 00:00:00 2001
From: Jeremy Tan <jtanx@outlook.com>
Date: Thu, 27 Dec 2018 20:28:27 +0800
Subject: [PATCH] Add Huawei alt mode support
diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl
index b1530bd..33f123b 100755
--- a/convert-modeswitch.pl
+++ b/convert-modeswitch.pl
@croxton
croxton / example.html
Last active May 5, 2024 23:02
Adds a `hx-history-preserve` attribute to preserve the initial dom state of an element's children for history (before it has been manipulated by JS).
<div id="my-unique-id" hx-history-preserve>
<p>Markup here wil be returned to it's original state on history restore.</p>
</div>
@juliensimon
juliensimon / benchmark.py
Last active May 5, 2024 23:02
Benchmark script
import time
import numpy as np
import torch
from transformers import pipeline
def benchmark(pipeline, data, iterations=1000):
# Warmup
for i in range(100):
@StephanTLavavej
StephanTLavavej / videos.md
Last active May 5, 2024 22:53
C++ Videos by Stephan T. Lavavej
@Azoy
Azoy / atomics.md
Last active May 5, 2024 22:44
Low-Level Atomic Operations
@Abdelazeem777
Abdelazeem777 / synchronous_future_example.dart
Created April 26, 2024 09:43
SynchronousFuture Exmaple
import 'package:flutter/foundation.dart';
Future<void> main() async {
String? output;
final myFuture = getData('myKey');
myFuture.then((data) => output = data);
if (output != null)
print(output);
@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active May 5, 2024 22:42
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active May 5, 2024 22:39
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@sjdawson
sjdawson / !simhub-scripts.js
Last active May 5, 2024 22:38
SimHub JS Scripts
// A collection of JS snippets that can be used in SimHub: https://github.com/SHWotever/SimHub