Skip to content

Instantly share code, notes, and snippets.

View amckinlay's full-sized avatar

Andrew McKinlay amckinlay

  • Gainesville, Florida
View GitHub Profile
@amckinlay
amckinlay / gist:166d96ec3aae168d8369f7634c5fd382
Last active July 25, 2018 18:51
list all files not tracked by git in a git repository. useful to browse data directories that are also software installations, e.g., ~/.nvm
git ls-files -oi --exclude-standard
also,
find . -exec git check-ignore {} + | sed 's/.\///'
or
git check-ignore **/*
git status --ignored
python2 -m virtualenv and python3 -m venv are two separate things. virtualenv is a pypi package and not included with python. virtualenv can be used with python3 instead of venv if desired (as nedbat does)
@amckinlay
amckinlay / gist:fce038b2508281f2aa45e9f075a201f6
Created March 5, 2017 21:53
Get changelogs for outdated pacman packages
pacman -Quq | xargs -I {} pacman -Qc {}
pkg-config --list-all shows all pkg-config compatible libraries available on a system
whatis -s 4 --wildcard "*" shows all the device interface manuals
use stdbuf from coreutils to attempt to disable io buffering for a command using ld_preload
@amckinlay
amckinlay / gist:060cead6222757f1e31155f0cf20cd1e
Last active January 26, 2017 02:31
ES note on object properties
object properties are either data descriptors or accessor descriptors
data descriptors have a value property (and writable property)
accessor descriptors have get/set properties
I don't know why mdn for Object.defineProperty() refers to these properties as either optional or requied since all properties have default values
the default values are assigned during property definition if not present in the descriptors prototype chain
okay, even the default values on mdn for Object.defineProperty() are a lie (check case where object property already exists)
writable can be changed to false when configurable is false (interesting possible race?)
also, value attribute can be changed with Object.defineProperty() when configurable is false if writable is true
hm, assignment silently fails when writable is false but Object.defineProperty() TypeErrors (compatibility?)
> typeof foo
"undefined"
but
> foo
ReferenceError: Can't find variable: foo
if something has a type it should exist (imo)
the number of links to a directory is the 1 + number of subdirectories, because each subdirectory has a .. to the parent directory
[alarm@alarmpi ~]$ stat .
File: .
Size: 16384 Blocks: 32 IO Block: 4096 directory
Device: b302h/45826d Inode: 260676 Links: 8
Access: (0700/drwx------) Uid: ( 1000/ alarm) Gid: ( 1000/ alarm)
Access: 2017-01-16 23:36:41.756275854 +0000
Modify: 2017-01-16 23:34:45.216513504 +0000
Change: 2017-01-16 23:34:45.216513504 +0000