Skip to content

Instantly share code, notes, and snippets.

Echo Nolan enolan

View GitHub Profile
View malloc_info.sh
#/usr/bin/env bash
# Convert the XML output of malloc_info() into CSV for putting into a spreadsheet
echo -n "$(date -u '+%F %T' --date=$(basename $1)),"
XMLCMD="xmlstarlet sel -I -t -v"
echo -n "$($XMLCMD 'count(//malloc/heap)' $1),"
echo -n "$($XMLCMD '//malloc/system[@type="current"]/@size' $1),"
echo -n "$($XMLCMD '//malloc/total[@type="fast"]/@size' $1),"
echo -n "$($XMLCMD '//malloc/total[@type="rest"]/@size' $1),"
View perf-subsample.hs
#!/usr/bin/env stack
-- stack --resolver lts-13.29 script --package regex-tdfa,conduit,bytestring,random-fu
-- Given a perf 'script', as emitted by 'perf script -i perf.data', subsample
-- at 0.1 probability to make the script small enough to load into e.g.
-- speedscope.
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
import Conduit
@enolan
enolan / default.nix
Created Mar 2, 2019
Nix derivation for RimWorld
View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "Rimworld-2150";
src = requireFile {
name = "RimWorld1-0-2150Linux.zip";
sha256 = "41f50499a8e39d11fa1eebfc3c5ae3e12a064b92f5a8af55680373b0aed6d81c";
message = "dude download the thing";
};
buildInputs = [autoPatchelfHook unzip gcc-unwrapped gtk2-x11 gdk_pixbuf glib];# libglvnd
View keybase.md

Keybase proof

I hereby claim:

  • I am enolan on github.
  • I am enolan (https://keybase.io/enolan) on keybase.
  • I have a public key ASDmhKeVmn1_S7L6MqdTyJHph_95THOYiMIfhkulkVKCZwo

To claim this, I am signing this object:

@enolan
enolan / gist:054bac17dde53ea0e139945c29c8ddb5
Last active Mar 13, 2017
Put your homework solutions here!
View gist:054bac17dde53ea0e139945c29c8ddb5
If you'd like to share your solution to the homework, please paste it as a comment here and we'll look at it.
It's totally okay if you got stuck.
URL: https://git.io/vyiE8
@enolan
enolan / jobs-finished.sh
Created Mar 4, 2017
Bash scripts for making a noise when a process finishes
View jobs-finished.sh
# I often start some command that takes a while (compiling, building containers, model training),
# then go and fuck around on the internet while waiting for it to finish. These scripts play the
# SCV "job's finished" sample from StarCraft when the process exits :)
# Usage:
# $ thing-that-takes-a-while ; talk
# Or, if you realize the thing's going to take a while after it starts:
# $ waitprocess $PID
@enolan
enolan / gist:5820f9c504aabba17e83ce612c75ddc5
Created Feb 10, 2017
vagrant up failure for calagator
View gist:5820f9c504aabba17e83ce612c75ddc5
enolan at behemoth in ~/mystuff/code/calagator [master]
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/trusty64'
default: URL: https://atlas.hashicorp.com/ubuntu/trusty64
==> default: Adding box 'ubuntu/trusty64' (v20170202.1.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20170202.1.0/providers/virtualbox.box
View gist:25aad1613c42fee5fcbf
C:\Users\Echo\Desktop\temp> stack build --only-snapshot --prefetch --dry-run --verbose
Version 1.0.2 x86_64
2016-01-20 21:08:18.524518: [debug] Checking for project config at: C:\Users\Echo\Desktop\temp\stack.yaml @(stack_17sBDK7EAGnHgWa8uDWGI4:Stack.Config src/Stack\Config.hs:660:9)
2016-01-20 21:08:18.525518: [debug] Loading project config file stack.yaml @(stack_17sBDK7EAGnHgWa8uDWGI4:Stack.Config src/Stack\Config.hs:683:13)
2016-01-20 21:08:18.527518: [debug] Trying to decode C:\Users\Echo\AppData\Roaming\stack\build-plan-cache\x86_64-windows\lts-3.16.cache @(stack_17sBDK7EAGnHgWa8uDWGI4:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:55:5)
2016-01-20 21:08:18.541519: [debug] Success decoding C:\Users\Echo\AppData\Roaming\stack\build-plan-cache\x86_64-windows\lts-3.16.cache @(stack_17sBDK7EAGnHgWa8uDWGI4:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:64:13)
2016-01-20 21:08:18.542519: [debug] Trying to decode C:\Users\Echo\AppData\Roaming\stack\indices\Hackage\00-index.cache @(stack
View stack.yaml
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html
# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-4.2
# Local packages, usually specified by relative directory name
packages:
- '.'
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
View cookieclicker.js
// rev 6 (updated for cookieclicker 2)
// use as bookmarket:
javascript:var Util = { maxBy: function (arr, gt) { 'use strict'; return arr.reduce(function (p, c) { if (gt(p, c)) { return p; } else { return c; } }); }, buildingValue: function (b) { 'use strict'; /* I don't think Orteil has any idea how JavaScript is supposed to work*/ return b.cps(b)*Game.globalCpsMult/b.price; }};function Automaton() { 'use strict'; this.plannedBuy = false; this.rafId = 0; this.controlPanel = {};}Automaton.prototype.update = function () { 'use strict'; var buybuildings = document.getElementById("buybuildingscheckbox").checked; var buyupgrades = document.getElementById("buyupgradescheckbox").checked; var click = document.getElementById("clickcheckbox").checked; var goldenClick = document.getElementById("goldencheckbox").checked; if (click) {document.getElementById("bigCookie").click(
You can’t perform that action at this time.