Skip to content

Instantly share code, notes, and snippets.

View mildsunrise's full-sized avatar
🦊
*rolls*

Alba Mendez mildsunrise

🦊
*rolls*
View GitHub Profile
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active April 24, 2024 15:14
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
@AndyShiue
AndyShiue / CuTT.md
Last active April 6, 2024 20:34
Cubical type theory for dummies

I think I’ve figured out most parts of the cubical type theory papers; I’m going to take a shot to explain it informally in the format of Q&As. I prefer using syntax or terminologies that fit better rather than the more standard ones.

Q: What is cubical type theory?

A: It’s a type theory giving homotopy type theory its computational meaning.

Q: What is homotopy type theory then?

A: It’s traditional type theory (which refers to Martin-Löf type theory in this Q&A) augmented with higher inductive types and the univalence axiom.

@mickael9
mickael9 / save.py
Last active June 28, 2021 07:58
Factorio map metadata parser
from zipfile import ZipFile
from struct import Struct
class Deserializer:
u16 = Struct('<H')
u32 = Struct('<I')
def __init__(self, stream):
self.stream = stream
@hkoba
hkoba / sched-reboot.service
Last active November 6, 2023 16:07
systemd service and timer for scheduled reboot.
[Unit]
Description=Scheduled Reboot
[Service]
Type=simple
ExecStart=/usr/bin/systemctl --force reboot
@a4lg
a4lg / tilejpeg.cpp
Last active February 13, 2024 15:32
Lossless JPEG tiling program for non-optimized images
/*
tilejpeg : lossless JPEG tiling program for non-optimized images
tilejpeg.cpp
Tile JPEG Program
Copyright (C) 2016 Tsukasa OI <floss_tilejpeg@irq.a4lg.com>
Based on the program code on <http://apostata.web.fc2.com/tilejpeg/index.html>.
@lg
lg / angry_wifi.sh
Last active November 28, 2023 23:56
auto disconnects clients with a low signal strength on LEDE / OpenWRT
#!/bin/ash
#
# angry_wifi.sh
#
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great
# for clients who hold onto a lower-signal-strength accesspoint instead of
# roaming. before running, make sure to download the latest MAC addresses with:
#
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses
#
@stefansundin
stefansundin / extract-attachments.py
Last active September 27, 2022 18:54
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
#!/usr/bin/env python3
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: https://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Instructions:
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original".
# Move the files to the same directory as this program, then run it.
import sys
@ajinabraham
ajinabraham / gifjs.asm
Last active November 16, 2023 07:20
A Valid GIF and JS file
; a hand-made GIF containing valid JavaScript code
; abusing header to start a JavaScript comment
; inspired by Saumil Shah's Deadly Pixels presentation
; Ange Albertini, BSD Licence 2013
; yamal gifjs.asm -o img.gif
WIDTH equ 10799 ; equivalent to 2f2a, which is '/*' in ASCII, thus starting an opening comment
@tstellanova
tstellanova / jetson_hdmi_config.md
Last active May 26, 2021 10:30
Enable and Disable HDMI display on Jetson TK1

All operations as root:

turn off HDMI:

echo -1 > /sys/kernel/debug/tegra_hdmi/hotplug
echo 4 > /sys/class/graphics/fb0/blank

turn on HDMI:

@evancz
evancz / Architecture.md
Last active December 21, 2022 14:28
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo