Skip to content

Instantly share code, notes, and snippets.

View androm3da's full-sized avatar

Brian Cain androm3da

View GitHub Profile
@ellishg
ellishg / ExtractMapSection.patch
Last active June 14, 2021 16:51
Measure Size and Runtime Performance of MIP
diff --git a/llvm/lib/CodeGen/MIPSectionEmitter.cpp b/llvm/lib/CodeGen/MIPSectionEmitter.cpp
index 715b595ec1eb..865fb18c75b4 100644
--- a/llvm/lib/CodeGen/MIPSectionEmitter.cpp
+++ b/llvm/lib/CodeGen/MIPSectionEmitter.cpp
@@ -328,6 +328,8 @@ void MIPSectionEmitter::serializeToMIPRawSection() {
}
void MIPSectionEmitter::serializeToMIPMapSection() {
+ // Do not create the `__llvm_mipmap` section when measuring size and runtime performance.
+ return;
@ldionne
ldionne / pre-push
Created November 9, 2018 19:26
Pre-push hook for LLVM monorepo
#!/bin/sh
# Pre-push hook making sure there is no merge commit in the set of commits
# being pushed upstream. This hooks works by walking the set of commits being
# pushed and making sure that none of them has two parents or more (which is
# the definition of a merge commit).
#
# This hook is called with the following parameters:
#
# ${1} -- Name of the remote to which the push is being done
# File: /etc/apt/apt.conf.d/docker-autoremove-suggests
# Since Docker users are looking for the smallest possible final images, the
# following emerges as a very common pattern:
# RUN apt-get update \
# && apt-get install -y <packages> \
# && <do some compilation work> \
# && apt-get purge -y --auto-remove <packages>
# By default, APT will actually _keep_ packages installed via Recommends or
@elmarco
elmarco / .clang-format
Created August 29, 2017 15:51
qemu .clang-format
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
@bonzini
bonzini / exec-hook.c
Created August 10, 2017 12:26
An LD_PRELOAD library that waits for a given binary to be exec-ed, and forces it under a gdbserver
/* Copyright (C) 2012-2017 by László Nagy
Copyright (C) 2017 Paolo Bonzini
This file is based on Bear.
It is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@jgrahamc
jgrahamc / airwolf.bas
Created May 9, 2017 18:00
AppleSoft BASIC program used in Airwolf S02E03 "Moffett's Ghost"
1 PP=2
10 HOME
12 PRINT
20 A$ = "0123456789ABCDEF"
30 FOR I = 1 TO 19
31 IF I = 9 THEN GOSUB 1000
40 L$ = ""
45 FOR J = 1 TO 9
50 L1 = INT ( RND (1) * 15 ) + 1: L2 = INT ( RND (1) * 15 ) + 1
60 L$ = L$ + MID$ (A$,L1,1) + MID$(A$,L2,1) + ": "
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gyjzh
gyjzh / merger.py
Created April 6, 2017 14:33 — forked from stepchowfun/merger.py
My three-way merge algorithm, originally designed for 6.033 DP2.
#!/usr/bin/python -O
################################################################################
################################################################################
#
# State-Based Text Merging Algorithm
# For 6.033 Design Project 2
# TA: Katherine Fang
# 9 May 2012
#
@dumbbell
dumbbell / bootstrapping-rust-freebsd-aarch64.md
Last active September 15, 2023 12:17
Bootstrapping Rust and Cargo on FreeBSD/aarch64

Bootstrapping Rust and Cargo on FreeBSD/aarch64

At the time of this writing, Rust and Cargo are available on FreeBSD/amd64 and FreeBSD/i386 only, whether it is from rustup or from the FreeBSD ports tree. Here is how I could bootstrap Rust and Cargo for FreeBSD/aarch64 from FreeBSD/amd64.

Base system for the target

To be able to cross-compile anything, you need a userland for the target.

From a release

#!/bin/sh -ex
apt-get update && apt-get install -y \
vim-gtk \
indent \
git \
mercurial \
subversion \
ruby-dev \
python \