Skip to content

Instantly share code, notes, and snippets.

View ento's full-sized avatar

ento

View GitHub Profile
#!/usr/bin/env python3
import sys
import math
from pathlib import Path
import glob
from collections import namedtuple
from subprocess import run, check_output, PIPE
import csv
default.nix
node-env.nix
node-packages.nix
@ento
ento / .gitignore
Last active October 31, 2018 19:45
.bundle/
.overcommit.yml
vendor/
@ento
ento / cloudtrail_overview.sh
Last active May 25, 2018 17:16
print CloudTrail event counts by username in all regions for the given time range
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
if [ "$#" -ne 2 ]; then
echo 'print CloudTrail event counts by username in all regions for the given time range.'
echo 'usage:'
echo " $0" 'start-time end-time'
echo 'example:'
"""
Replace all NEEDEDs of all ELF files in /nix/store with absolute paths.
Requires python-magic.
"""
from __future__ import print_function
import os.path
import subprocess
from collections import namedtuple
import functools
@ento
ento / include-exclude-precedence.md
Created October 1, 2017 21:56
include-exclude-precedence

Include/exclude precedence in lint-like tools

Ad hoc research for deciding how to implement file inclusion/exclusion logic in elm-doc.

Notes:

  • Listed up lint-like tools I know off the top of my head, and then supplemented by cherry-picking tools from awesome-static-analysis
  • "Included" here means explicitly included by being specified in the command line, not just in a config file.
  • I either tried out each tool to see how it actually behaves, or looked at existing issues or actual code.
  • Numbers
((elm-mode
(eval . (progn
(require 'projectile)
(setq elm-format-elm-version "0.18")
(setq elm-format-command "elm-format-0.18")))))
@ento
ento / bllip.py
Created November 17, 2016 19:10
Simpler formatting of syntax trees: ((The quick brown fox) (jumps (over (the lazy dog))))
# Patch to make nltk.parse.bllip.py work in Python 3
def _ensure_ascii(words):
try:
for i, word in enumerate(words):
if isinstance(word, bytes):
word.decode('ascii')
else:
word.encode('ascii')
except UnicodeDecodeError:
gistup
{ "path": "path/to/Main'.elm", "line": 1, "column": 1, "message": "<file would change>"}
{ "path": "path/to/Main'.elm", "line": 2, "column": 1, "message": "file would change"}
{ "path": "path/to/View.elm", "line": 1, "column": 1, "message": "file would change"}