Skip to content

Instantly share code, notes, and snippets.

View grahamc's full-sized avatar
❄️

Graham Christensen grahamc

❄️
View GitHub Profile
[1] grahamc@Morbo> ./result/bin/daps ~/projects
Usage:
1. daps -d DC-file [--options] <subcommand> [--subcommand-options]
2. daps -m MAIN file [--options] <subcommand> [--subcommand-options]
Global Options:
--builddir=BUILD_DIR Directory where every output daps generates will
end up.
Default: <doc dir>/build/
@grahamc
grahamc / some.nix
Last active October 15, 2017 23:39 — forked from dustinlacewell-wk/some.nix
emacs = {
buildOrg = {emacs ? emacs25-nox, init ? ./init.org}:
runCommand "init.el"
{ buildInputs = [ emacs ]; }
''
mkdir -p $out;
ln -s "${init}" ./init.org;
emacs -Q --script "${./assets/org-build.el}" -f make-init-el;
cp init.el $out;
'';

Keybase proof

I hereby claim:

  • I am grahamc on github.
  • I am graham (https://keybase.io/graham) on keybase.
  • I have a public key ASAC4QV3QF3tHxELFdSoMZfq3w19D4ODgBfoTesOz_4kQgo

To claim this, I am signing this object:

@grahamc
grahamc / 0_reuse_code.js
Created June 14, 2017 21:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bind.dnsutils -p traceroute -p curl
# impure: needs ping
#source: https://s3.amazonaws.com/aws-cloudfront-testing/CustomerTesting.html
function _e {
echo "> $@"
eval "$@" 2>&1 | sed -e "s/^/ /"
printf "Exit: %s\n\n\n" "$?"
}
@grahamc
grahamc / default.nix
Last active March 25, 2017 01:10 — forked from Taeradan/default.nix
trying conditional imports
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
{
@grahamc
grahamc / tag.sh
Last active March 14, 2017 21:57
msg_list() {
query="tag:nixossec tag:needs-triage and date:2017-02-22.. and not tag:package-identified"
notmuch search "$query" | tr '[:upper:]' '[:lower:]'
}
score_subject() {
# For each word in the subject, search for a package by that name
# sort by the number of hits
# remove 0-hit words
# pick the word with the fewest hits
#!/nix/store/010yd8jls8w4vcnql4zhjbnyp2yay5pl-bash-4.4-p5/bin/bash
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
PATH="/nix/store/9lhgvxka8m162d5db0my5cd4qpjii9sv-git-2.12.0/bin"
@grahamc
grahamc / emacs-init-as-a-package.nix
Created February 27, 2017 14:39
Package your user's emacs init.el etc. in to your nix emacs itself
{ pkgs ? import <nixpkgs> {} }:
let
emacsPackaging = pkgs.emacsPackagesNg;
my-mode = emacsPackaging.trivialBuild {
pname = "my-mode";
version = "1970-01-01";
src = pkgs.writeText "default.el" ''
(global-set-key (kbd "<end>") 'end-of-line)
(global-set-key (kbd "<home>") 'beginning-of-line)
@grahamc
grahamc / nixos-on-dell-9560.org
Last active December 1, 2017 22:02
NixOS on a Dell 15" 9560 with the 4K screen.