Skip to content

Instantly share code, notes, and snippets.

View alex-ameen's full-sized avatar

Alex Ameen alex-ameen

  • Block
  • Austin Texas
View GitHub Profile
@alex-ameen
alex-ameen / nix-search.sh
Created March 13, 2019 01:27
FZF Fuzzy search for NixOS Options and Packages
#! /usr/bin/env bash
# Provided a list of package and option names (provided by my `writeOpts.sh` and
# `writePacks.sh` scripts), fuzzy search package and options information.
# The selection's definition will be opened in vim (as readonly) for viewing.
# NOTE: This script opens the result in a new URxvt window, you most likely will want
# to change that to open in the current window, or your own Terminal Emulator of
# choice. The current implementation is intended for use with a temporary XMonad
# scratchpad, which dies immediately after exiting (thus a new URxvt window is
# required).
@alex-ameen
alex-ameen / lorem.h
Last active March 18, 2019 08:41
Lorem Ipsum inputs for DVP HW7.1
/* 10K, 100K, and 1000K strings of filler. */
/* Offset versions are unaligned the signified bytecount. */
char * lorem10; /* Alias for lorem10_off0 */
char * lorem10_off0, * lorem10_off1, * lorem10_off2, * lorem10_off3;
char * lorem10_off4, * lorem10_off5, * lorem10_off6, * lorem10_off7;
char * lorem100; /* Alias for lorem100_off0 */
char * lorem100_off0, * lorem100_off1, * lorem100_off2, * lorem100_off3;
char * lorem100_off4, * lorem100_off5, * lorem100_off6, * lorem100_off7;
char * lorem1000; /* Alias for lorem1000_off0 */
@alex-ameen
alex-ameen / .sbclrc-local.lisp
Created August 6, 2019 23:48
localized CLISP shell.nix
;; -*- mode: lisp-mode -*-
;; Load Quicklisp, initialize if missing.
(defparameter *first-run* nil)
(let* ((ql-dir (merge-pathnames "quicklisp/" (user-homedir-pathname)))
(ql-init (merge-pathnames "setup.lisp" ql-dir)))
(when (not (probe-file ql-dir))
(sb-ext:run-program "/usr/bin/env" '("quicklisp" "init")
:input t :output t)
(setq *first-run* t))
@alex-ameen
alex-ameen / colors.nix
Last active August 9, 2019 20:08
Color Modules for Home-Manager or NixOS
{ config, lib, pkgs, ... }:
with lib;
let
colors = config.colors;
BtoString = cond: if cond then "true" else "false";
oSN = k: v: optionalString (v != null) "${k}: ${v}";
/*
* Install this extension by pasting this script into a "JavaScript Injector" add-on for your browser.
* For Chrome on Desktop try "Custom JavaScript for websites". (Chrome on Mobile does not support add-ons)
* For Firefox "JS Injector" works for both Mobile and Desktops.
*
* What it does:
* - 91-93% IV Pokemon are highlighted in Yellow.
* - 96-98% IV Pokemon are highlighted in Orange.
* - 100% IV Pokemon are highlighted in Red. (same as the default site)
* - Pokemon with known IVs 0-89% are highlighted in Blue.
/* -*- mode: c; -*- */
/* ========================================================================= *
*
* This file has been written in order to easily wrap existing C programs,
* and test their runtime.
*
* It simply runs `main' of the wrapped program repeatedly, and provides an
* average of timed runs. Whatever it is that you actually want to time
* should be placed there, which is not always ideal for large existing
/* -*- mode: c; -*- */
/* ========================================================================= */
#include "pokedex.h"
#include "moves.h"
#include "ptypes.h"
#include <stdlib.h>
#include <stdint.h>
#ifndef MACROS_H
#define MACROS_H
/* Assert the use of GCC so we can use extension. */
#ifndef __GNUC__
#error "__GNUC__ not defined"
#else /* def __GNUC__ */
/* ======================================================================== */
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
/* Type Compatibility */
#define is_compatibleT(_CX, _CT) _Generic((_CX), _CT:1, default: 0)
#define is_compatibleV(_C2X, _C2V) is_compatibleT (_C2X, typeof (_C2V))
@alex-ameen
alex-ameen / README.md
Last active January 28, 2021 07:10
List all ELF files recursively from a set of directories

Note:

Parts of this snippet were taken from the Open Source utility "pax-utils" https://pax.grsecurity.net/, this gist not intended for distribution or packaging into commercial software without the consent of the original authors. These are the portions related to processing AR archives, which were slighly modified to make them usable outside of the scanelf utility.

This clipping is intented for individual use.

The code which was expropriated from grsecurity's open source project is under GNU Public License V2