Skip to content

Instantly share code, notes, and snippets.

View Maxr1998's full-sized avatar

Max Rumpf Maxr1998

View GitHub Profile
@hanzoh
hanzoh / battery_sim.sql
Last active March 3, 2025 20:46
Simulate home battery from Home Assistant data
drop table tmp_battery_sim;
create table tmp_battery_sim (start timestamp without time zone, energy_in_battery numeric, energy_not_consumed_from_grid numeric, savings_from_battery numeric);
do $$
declare
-- Variables
t record;
vn_battery numeric := 0.0;
vn_battery_prev numeric := 0.0;
vn_grid_savings numeric := 0.0;
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active May 6, 2025 12:31 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: April 2025

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

@FreddieOliveira
FreddieOliveira / docker.md
Last active May 7, 2025 07:17
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@Mic92
Mic92 / iwd_migration.py
Last active July 1, 2024 13:28
Convert networkmanager/wpa_supplicant WPA/WPA2 networks to iwd networks
import glob
import re
import sys
import os
import subprocess
import curses.ascii
import binascii
from typing import Tuple, Optional
def parse_network_manager(filename: str) -> Tuple[Optional[str], Optional[str]]:

Credit to @cketti for the original steps

If you are annoyed that "Sources for Android 28" are not yet available via SDK manager, this might be for you:

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build
@pvieito
pvieito / gist:ee6d2c8934a8f84b9aeb467585277b8a
Last active March 13, 2025 07:53
Consumer keys of official Twitter clients

Twitter API Keys

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

# you need jq installed
set GITHUB_USER <YOUR USER NAME>
complete -c git -n "string match -r '^git clone.*' (commandline) > /dev/null ; echo $status" -a '(curl -Ls https://api.github.com/users/$GITHUB_USER/repos|jq ".[]|.clone_url" -c|string replace -a "\"" "")'
@nickbutcher
nickbutcher / MainActivity.java
Last active August 20, 2021 16:15
A quick sample of the new physics-based animation library added in Support Library 25.3.0 docs: https://developer.android.com/reference/android/support/animation/package-summary.html output: https://twitter.com/crafty/status/842055117323026432
/*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@TimKraemer
TimKraemer / wifionice
Last active September 30, 2024 16:05 — forked from vollkorn1982/wifionice
HowTo auto connect your Linux to the German Wifi on ICE trains
#!/bin/sh
# put this file in /etc/network/if-up.d/
if iwconfig wlp4s0 | grep -c "ESSID:\"WIFIonICE\""
then
curl -s "https://www.ombord.info/hotspot/hotspot.cgi?connect=&method=login&realm=db_advanced_wifi"
fi
@gkbrk
gkbrk / lolcat.asm
Created July 27, 2016 13:26
Lolcat clone in x64 assembly
section .data
char_buffer db 0
section .text
global _start
_start:
mov r12, 0
.loop:
call read_char