Skip to content

Instantly share code, notes, and snippets.

@r-darwish
r-darwish / theme.yml
Created December 27, 2018 08:25
Alacritty One Dark Theme
colors:
# Default colors
primary:
background: '0x1e2127'
foreground: '0xabb2bf'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
@thesamesam
thesamesam / xz-backdoor.md
Last active May 11, 2024 01:58
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@brimston3
brimston3 / MQTTTransport_mbedTLS.cpp
Created September 12, 2017 15:08
paho.mqtt.embedded-c (C++) with mbedTLS example
/*******************************************************************************
* Copyright 2017 Andrew Domaszek
*
* All rights reserved.
* This program made available under BSD-new.
*******************************************************************************/
/**
* This example is designed for Linux, using such calls as setsockopt and gettimeofday.
* On embedded, it's likely that all of the mbedtls_net_* functions would need to be
@ssokolow
ssokolow / update_flatpak_cli.py
Last active May 11, 2024 01:51
Utility for making Flatpak-installed apps available in the terminal through their normal command names
#!/usr/bin/env python3
"""Flatpak CLI Shortcut Generator
A simple no-argument tool that generates launchers with traditional non-flatpak
command names for your installed Flatpak applications in ~/.local/bin/flatpak.
Does full collision detection and warns you if you forgot to add its output
directory to your PATH. Also overrules the command-line specified in the
``.desktop`` file if the Flatpak maintainer didn't include support for
command-line arguments.
@leocomelli
leocomelli / git.md
Last active May 11, 2024 01:48
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@deshion
deshion / get_options.sh
Last active May 11, 2024 01:44
Parse command line options for a shell script (POSIX)
#!/bin/sh
# POSIX
# Reset all variables that might be set
file=
verbose=0 # Variables to be evaluated as shell arithmetic should be initialized to a default or validated beforehand.
while :; do
case $1 in
-h|-\?|--help) # Call a "show_help" function to display a synopsis, then exit.
@parmentf
parmentf / GitCommitEmoji.md
Last active May 11, 2024 01:41
Git Commit message Emoji
@chriseidhof
chriseidhof / sample.swift
Last active May 11, 2024 01:33
View Inspection
import SwiftUI
struct SizeKey: PreferenceKey {
static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) {
value = value ?? nextValue()
}
}
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {
@Hirrolot
Hirrolot / a-main.ml
Created March 23, 2023 16:04
A simple CPS conversion as in "Compiling with Continuations", Andrew W. Appel
(* A variable identifier of the lambda language [term]. *)
type var = string [@@deriving eq]
(* The lambda language; direct style. *)
type term =
| Var of var
| Fix of (var * var list * term) list * term
| Appl of term * term list
| Record of term list
| Select of term * int
@Hirrolot
Hirrolot / a-preface.md
Last active May 11, 2024 01:27
A complete implementation of the positive supercompiler from "A Roadmap to Metacomputation by Supercompilation" by Gluck & Sorensen

Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:

A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by the program; let us call this machine M1. In observing the operation of