Skip to content

Instantly share code, notes, and snippets.

Michael F. Lamb datagrok

View GitHub Profile
@datagrok
datagrok / deploy.sh
Created Sep 30, 2012
Minimal Race-free Deployment
View deploy.sh
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
@datagrok
datagrok / README.md
Last active Mar 12, 2019
What's the best way to write function pipelines in Python?
View README.md

I agree with Guido, in that I think

[ x * 2 for x in some_list if x < 12 ]

is much easier to read than the equivalent

map(lambda x:x * 2, filter(lambda x:x<12, some_list))
@datagrok
datagrok / learn.md
Last active Mar 12, 2019
Things I want to (and don't want to) learn
View learn.md

Things to learn

There's too many things I'm interested in. There's also many hyped technologies and subjects out there that I am disinclined to pay attention to.

When I have the impulse to dig into some subject, I find myself wanting a list to run-down so I know in advance where that idea might land given all the other things I already have in-progress.

Listed in approximate order from high- to low-interest.

  • 💡💰 Recommender Systems
@datagrok
datagrok / vendoring.md
Last active Mar 11, 2019
"Vendoring" is a vile anti-pattern
View vendoring.md

"Vendoring" is a vile anti-pattern

What is "vendoring"?

From a comment on StackOverflow:

Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.

The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.

@datagrok
datagrok / README.md
Last active Mar 11, 2019
What happens when you cancel a Jenkins job
View README.md

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@datagrok
datagrok / .gitignore
Last active Mar 10, 2019
get_favs.py: quick and dirty script to archive twitter favs (aka "likes")
View .gitignore
creds.py
favs.db*
@datagrok
datagrok / git-branch-simplify.md
Last active Mar 5, 2019
How to simplify the graph produced by git log --graph
View git-branch-simplify.md

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@datagrok
datagrok / gist:2199506
Last active Feb 26, 2019
Virtualenv's `bin/activate` is Doing It Wrong
View gist:2199506
@datagrok
datagrok / pep8-alignment.md
Last active Jan 14, 2019
PEP-8's inconsistent alignment recommendation
View pep8-alignment.md
@datagrok
datagrok / ergodox.md
Last active Jan 14, 2019
Reflections on my ErgoDox keyboard
View ergodox.md
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.