Skip to content

Instantly share code, notes, and snippets.

View null-dev's full-sized avatar
💭
I may be slow to respond.

Andy Bao null-dev

💭
I may be slow to respond.
View GitHub Profile
@null-dev
null-dev / Cargo.toml
Created July 2, 2021 09:12
Import likes from Soundcloud into NewPipe.
[package]
name = "NewPipeSoundcloudImport"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rusqlite = "0.25.3"
reqwest = "0.11.4"
@null-dev
null-dev / test.java
Last active March 29, 2022 05:31
QuestDB Test
@Test
public void testTimestamp() throws Exception {
TestUtils.assertMemoryLeak(() -> {
try (final PGWireServer ignored = createPGServer(1)) {
try (final Connection connection = getConnection(false, true)) {
connection.setAutoCommit(false);
connection.prepareStatement("create table ts (ts timestamp) timestamp(ts) partition by month").execute();
connection.prepareStatement("insert into ts (ts) values ('2021-09-27T16:45:03.202345Z')").execute();
connection.commit();
connection.setAutoCommit(true);
@null-dev
null-dev / index.php
Created June 19, 2017 23:51
1fichier.com direct link generator (PHP)
<?php
if(!isset($_GET['a'])) {
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>');
}
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline";
stream_context_set_default(array(
'http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]'
@null-dev
null-dev / theme.js
Last active April 11, 2023 00:56
Slimmed down Bing AI Dark Theme
(function() {
'use strict';
// Disable scroll up: https://greasyfork.org/vi/scripts/461533-disable-bingchat-scroll-up/code
window.addEventListener("wheel", e=>{
if(e.target.className.includes("cib-serp-main")) e.stopPropagation();
});
// Core theme CSS, based on: https://github.com/darkreader/darkreader/issues/10784#issuecomment-1500925640
function injectCSS(node, shadowRoot) {
@null-dev
null-dev / disable-fb.sh
Created January 7, 2021 06:50
Disable efifb at runtime
#!/usr/bin/env bash
# 1. Download and install the QEMU hook helper from here: https://github.com/PassthroughPOST/VFIO-Tools
# 2. Place this file in /etc/libvirt/hooks/qemu.d/NAME OF YOUR VM/prepare/begin/disable-fb.sh
# 3. Make disable-fb.sh executable.
VM_NAME="$1"
echo "libvirt-qemu disable-fb: Disabling efi-framebuffer to prepare to pass GPU to VM $VM_NAME" > /dev/kmsg 2>&1
echo "efi-framebuffer.0" > /sys/bus/platform/devices/efi-framebuffer.0/driver/unbind