Skip to content

Instantly share code, notes, and snippets.

private val DefaultHighlightWidth = 136.dp
private val DefaultDuration = 1200.milliseconds
private val DefaultDelay = 1.seconds
private val DefaultStartColor = Color(0x32394A00)
private val DefaultMiddleColor = Color.White
private val DefaultEndColor = DefaultStartColor
private const val DefaultAlpha = 0.2F
private val DefaultShape = RoundedCornerShape(12.dp)
@Composable
@ricksladkey
ricksladkey / log.py
Last active April 25, 2024 12:27
Example Python script for GDB that reads and displays the text in a ring buffer every time the program stops
from __future__ import print_function
import struct
import gdb
def log():
# Get the inferior.
try:
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 25, 2024 12:27
ๅ›ฝๅ†…็š„ Docker Hub ้•œๅƒๅŠ ้€Ÿๅ™จ๏ผŒ็”ฑๅ›ฝๅ†…ๆ•™่‚ฒๆœบๆž„ไธŽๅ„ๅคงไบ‘ๆœๅŠกๅ•†ๆไพ›็š„้•œๅƒๅŠ ้€ŸๆœๅŠก | Dockerized ๅฎž่ทต https://github.com/y0ngb1n/dockerized

Docker Hub ้•œๅƒๅŠ ้€Ÿๅ™จ

ๅ›ฝๅ†…ไปŽ Docker Hub ๆ‹‰ๅ–้•œๅƒๆœ‰ๆ—ถไผš้‡ๅˆฐๅ›ฐ้šพ๏ผŒๆญคๆ—ถๅฏไปฅ้…็ฝฎ้•œๅƒๅŠ ้€Ÿๅ™จใ€‚Docker ๅฎ˜ๆ–นๅ’Œๅ›ฝๅ†…ๅพˆๅคšไบ‘ๆœๅŠกๅ•†้ƒฝๆไพ›ไบ†ๅ›ฝๅ†…ๅŠ ้€Ÿๅ™จๆœๅŠกใ€‚

Dockerized ๅฎž่ทต https://github.com/y0ngb1n/dockerized

้…็ฝฎๅŠ ้€Ÿๅœฐๅ€

Ubuntu 16.04+ใ€Debian 8+ใ€CentOS 7+

@xgroleau
xgroleau / sonarr-symlink.sh
Last active April 25, 2024 12:27
symlink script for sonarr
@MarkusH
MarkusH / serial-to-identity.sql
Last active April 25, 2024 12:26
A script that outputs the raw SQL to convert Django's serial columns to identity columns.
WITH tab AS (
SELECT
a.attrelid::regclass::text AS t,
a.attname AS c,
pg_get_serial_sequence(a.attrelid::regclass::text, a.attname) AS s,
nextval(pg_get_serial_sequence(a.attrelid::regclass::text, a.attname)) AS v
FROM pg_attribute a
JOIN pg_class c ON c.oid = a.attrelid
WHERE
a.attrelid::regclass::text LIKE '%'
@FreddieOliveira
FreddieOliveira / docker.md
Last active April 25, 2024 12:24
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

@kunicmarko20
kunicmarko20 / Readme.md
Last active April 25, 2024 12:24
ThinkPad keeps turning off because temprature is too high when charging

Thinkpad (Lenovo ThinkPad X1 Carbon Gen 9) Overheating resolved

This laptop overheats a lot, which makes it turn off a lot. As soon as I connect it to charger and I am in balanced power mode, CPU temp goes over 100.

This script will switch power mode to "power saving" when charging which should keep the temperatur around 60.

@sam0737
sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@vtta
vtta / acmart.typ
Last active April 25, 2024 12:23
acmart typst template
// made according to typst ieee template and official acm word template
// --- Draft Formatting
// Papers will be submitted electronically in PDF format via the web submission form.
// 1. Submissions may have at most 12 pages of technical content, including all text, figures, tables, etc. Bibliographic references are not included in the 12-page limit.
// 2. Use A4 or US letter paper size, with all text and figures fitting inside a 178 x 229 mm (7 x 9 in) block centered on the page, using two columns separated by 8 mm (0.33) of whitespace.
// 3. Use 10-point font (typeface Times Roman, Linux Libertine, etc.) on 12-point (single-spaced) leading.
// 4. Graphs and figures should be readable when printed in grayscale, without magnification.
class DJS{
private:
vector<int> size;
vector<int> parent;
public:
DJS(int n){
size.resize(n, 0);
parent.resize(n, 0);
for(int i = 0 ; i < n; i++){
parent[i] = i;