Skip to content

Instantly share code, notes, and snippets.

View fuse-ld-mold.patch
From ad964f7eaef9c03ce68a01cfdd7fde9d56524868 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 21 Dec 2021 17:43:55 +0100
Subject: [PATCH] Support ld.mold linker.
gcc/ChangeLog:
* collect2.c (main): Add ld.mold.
* common.opt: Add -fuse-ld=mold.
* doc/invoke.texi: Document it.
View gist:b6e43f787df9cf6bd9ab333f2066fc26
static size_t debug_itoa(int value, char *buf, unsigned int radix, int sign) {
int neg = 0;
char *pbuf = buf;
unsigned int i;
unsigned int len;
if (radix > 16) {
*buf = '\0';
return 0;
}
View gen_package_cache.erl
#!/usr/bin/env escript
% -*- erlang -*-
%
% Copyright 1999-2021 Gentoo Authors
% Distributed under the terms of the GNU General Public License v2
%
% A small script to generate the ETS table that represents Rebar 3's
% package cache.
-module(gen_package_index).
@00-matt
00-matt / runelite.sh
Last active Mar 11, 2021
RuneLite Launcher
View runelite.sh
#!/bin/sh
set -e
set -u
CONFIG_DIR="$HOME/.config/runelite-${1:-main}"
RUNELITE_DIR="$HOME/src/runelite"
cd "$RUNELITE_DIR"
View format-irclog-irccloud.sh
#!/bin/sh
# Usage: format-irclog.sh <file>
# 1. Append two spaces to the end of each line.
# 2. Remove all characters before last `<`, e.g. `<matterbridge> <sgp> foo` becomes `<sgp> foo`.
# 3. Remove lines containing `⇐` (parts).
# 4. Remove lines containing `→` (joins).
# 5. Escape the `*` character, e.g. `*foo*` becomes `\*foo\*`.
# 6. Escape the `<` character, e.g. `<3` becomes `\<3`.
View disable-scroll-bars.el
(defun disable-scroll-bars (frame)
(modify-frame-parameters frame
'((vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil))))
(disable-scroll-bars frame-initial-frame)
(add-hook 'after-make-frame-functions #'disable-scroll-bars)
View FindLibUV.cmake
find_path(LIBUV_INCLUDE_DIR NAMES uv.h)
mark_as_advanced(LIBUV_INCLUDE_DIR)
find_library(LIBUV_LIBRARY NAMES uv libuv)
mark_as_advanced(LIBUV_LIBRARY)
if(DEFINED LIBUV_INCLUDE_DIR AND EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _LIBUV_H REGEX
"#define UV_VERSION_(MAJOR|MINOR|PATCH) [0-9]+")
foreach(c MAJOR MINOR PATCH)
View FindHttpParser.cmake
find_path(HTTP_PARSER_INCLUDE_DIR NAMES http_parser.h)
mark_as_advanced(HTTP_PARSER_INCLUDE_DIR)
find_library(HTTP_PARSER_LIBRARY NAMES http_parser libhttp_parser)
mark_as_advanced(HTTP_PARSER_LIBRARY)
if(DEFINED HTTP_PARSER_INCLUDE_DIR)
file(STRINGS "${HTTP_PARSER_INCLUDE_DIR}/http_parser.h" _HTTP_PARSER_H REGEX
"#define HTTP_PARSER_VERSION_(MAJOR|MINOR|PATCH) [0-9]+")
foreach(c MAJOR MINOR PATCH)
@00-matt
00-matt / JsonRpcClient.js
Created Sep 21, 2019
A Node.js JSON-RPC client
View JsonRpcClient.js
/*
* JsonRpcClient.js 1.0 - A Node.js JSON-RPC client
*
* Written in 2019 by Matt Smith <matt@offtopica.uk>
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to
* the public domain worldwide. This software is distributed without
* any warranty.
*
View hexify.sh
#!/bin/sh
# IN: deadbeef
# OUT: \xde\xad\xbe\xef
hexify() {
echo "$1" | fold -w 2 | sed -e 's/^/\\x/' | paste -s -d ''
}