Skip to content

Instantly share code, notes, and snippets.

@IanKeen
IanKeen / AutoObjectiveCBridgeable.swift
Created October 10, 2018 04:18
AutoObjectiveCBridgeable
protocol AutoObjectiveCBridgeable: _ObjectiveCBridgeable where _ObjectiveCType == ObjcType {
associatedtype ObjcType
func toObjectiveC() -> ObjcType
static func fromObjectiveC(_ instance: ObjcType) -> Self
}
extension AutoObjectiveCBridgeable {
// MARK: - _ObjectiveCBridgeable
func _bridgeToObjectiveC() -> ObjcType {
@luxluth
luxluth / config.jsonc
Created May 5, 2024 16:19
Waybar config
{
"layer": "top",
"position": "top",
"exclusive": true,
"passthrough": false,
"gtk-layer-shell": true,
"ipc": "/tmp/waybar.sock",
"height": 0,
"modules-left": ["hyprland/workspaces"],
@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