Skip to content

Instantly share code, notes, and snippets.

Avatar

Jasper jbg

  • ::/0
View GitHub Profile
View archlinux.ipxe
#!ipxe
imgtrust
set release 2020.12.01
set mirrorurl http://mirror.rackspace.com/archlinux/
kernel ${mirrorurl}iso/${release}/arch/boot/x86_64/vmlinuz-linux
imgverify vmlinuz-linux ${mirrorurl}iso/${release}/arch/boot/x86_64/vmlinuz-linux.ipxe.sig
initrd ${mirrorurl}iso/${release}/arch/boot/amd-ucode.img
imgverify amd-ucode.img ${mirrorurl}iso/${release}/arch/boot/amd-ucode.img.ipxe.sig
initrd ${mirrorurl}iso/${release}/arch/boot/intel-ucode.img
imgverify intel-ucode.img ${mirrorurl}iso/${release}/arch/boot/intel-ucode.img.ipxe.sig
@jbg
jbg / panel-jd35695b.c
Created Jun 4, 2020
DSI driver for the nexus 5x
View panel-jd35695b.c
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2019, The Linux Foundation. All rights reserved.
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
View option_asyncmap.rs
use std::future::Future;
use futures::future::{self, Either, FutureExt, Map, Ready};
trait AsyncOption<T> {
fn async_map<U, Fun, Fut>(
self,
f: Fun,
) -> Either<Map<Fut, &'static dyn Fn(Fut::Output) -> Option<U>>, Ready<Option<U>>>
where
View tcpdump.rs
#![feature(never_type)]
use std::io;
use pnet::{
packet::ip::IpNextHeaderProtocols,
transport::{ipv4_packet_iter, transport_channel, TransportChannelType},
};
fn main() -> Result<!, io::Error> {
View hyper_error.rs
/*
ct-logs = "0.6.0"
http = "0.1.18"
hyper = "0.12.33"
hyper-rustls = "0.17.0"
rustls = "0.16.0"
tokio = "0.1.22"
webpki-roots = "0.17.0"
*/
View sumup-openapi.json.diff
--- old-openapi.json 2019-07-04 12:50:46.000000000 +0100
+++ openapi.json 2019-07-04 12:50:33.000000000 +0100
@@ -1417,21 +1417,27 @@
"name": "id",
"description": "SumUp unique transaction ID or transaction code, e.g. TS7HDYLSKD.",
"required": true,
- "type": "string"
+ "schema": {
+ "type": "string"
+ }
@jbg
jbg / TextEditingRawKeyboardListener.dart
Last active Jan 23, 2019
Text editing keyboard shortcuts in Flutter
View TextEditingRawKeyboardListener.dart
const KEYCODE_A = 0;
const KEYCODE_HOME = 115;
const KEYCODE_DEL = 117;
const KEYCODE_END = 119;
const KEYCODE_LEFT = 123;
const KEYCODE_RIGHT = 124;
class TextEditingRawKeyboardListener extends StatelessWidget {
final Widget child;
final FocusNode focusNode;
View i3-bar.py
#!/usr/bin/python3
from collections import OrderedDict
from datetime import datetime
from functools import partial
import json
import logging as log
import os
from queue import Queue, Empty
import subprocess
@jbg
jbg / powerchange
Created Jul 21, 2017
Script to run on udev power_supply events to adjust Macbook performance for battery/AC
View powerchange
#!/bin/sh -e
# Executed by udev upon power supply status changes using this rule:
# SUBSYSTEM=="power_supply", RUN+="/usr/local/bin/powerchange"
# This script sets minimum performance on battery. Adjust to suit.
BATTERY_BRIGHTNESS=250
# AC brightness is the maximum level.
if [ $POWER_SUPPLY_ONLINE = 1 ]; then