Skip to content

Instantly share code, notes, and snippets.

root@8a3802714172:/foo# pipenv --venv
/root/.local/share/virtualenvs/foo-YJbvrhmB
root@8a3802714172:/foo# ls /root/.local/share/virtualenvs/foo-YJbvrhmB/lib/python3.5/site-packages/
Django-1.11.10.dist-info confusable_homoglyphs django easy_install.py pip-9.0.1.dist-info pytz registration setuptools-38.5.0.dist-info wheel-0.30.0.dist-info
__pycache__ confusable_homoglyphs-3.0.0.dist-info django_registration-2.4.1.dist-info pip pkg_resources pytz-2017.3.dist-info setuptools wheel
mw@lapicero:~ % docker run -it ubuntu:16.04 bash
root@8a3802714172:/# apt-get update; apt-get install -y python3-pip
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [57.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [553 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
@maw
maw / indent.js
Created September 25, 2016 22:59
indent blanks!
if (foo) {
// I like how the next three^Wfour lines are indented
var x = 1 + 2;
x += 100;
// I dislike how the next three lines are indented
var z = 99;
z -= 4'

Keybase proof

I hereby claim:

  • I am maw on github.
  • I am mawolf (https://keybase.io/mawolf) on keybase.
  • I have a public key ASBeiDCW0DlaXdyfLEL1mD6o4yJJvcPPECsCtiP21I-PDQo

To claim this, I am signing this object:

;; http://emacs.stackexchange.com/a/3174 via xtreak on freenode
(defun youngfrog/copy-rectangle-to-kill-ring (start end)
"Saves a rectangle to the normal kill ring. Not suitable for yank-rectangle."
(interactive "r")
(let ((lines (extract-rectangle start end)))
(with-temp-buffer
(while lines ;; insert-rectangle, but without the unneeded stuff
;; (most importantly no push-mark)
(insert-for-yank (car lines))
@maw
maw / bicommand.py
Created January 31, 2012 17:05
replacement for commands.getstatusoutput that prints as it goes
# -*- python -*-
# This meant as a replacement for commands.getstatusoutput. By default, it
# works more or less identically. However, if you pass showoutput=True as
# its second parameter, it will show the process of your command as it goes.
# This is useful for long-running commands whose output is interesting to
# watch as well as to programatically analyse once it's finished.
# Maybe we could also consider a way to pass callbacks, or something, to
# run for each line. Or this could be broken down a bit, with simpler
@maw
maw / lorem-ipsum-caesaris.el
Last active September 29, 2015 16:28
placeholder text in real Latin
(defun lorem-ipsum-caesaris ()
(interactive)
(insert "Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
appellantur. Hi omnes lingua, institutis, legibus inter se
differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona
et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea
quod a cultu atque humanitate provinciae longissime absunt,
minimeque ad eos mercatores saepe commeant atque ea quae ad
effeminandos animos pertinent important, proximique sunt
@maw
maw / gist:1184105
Created August 31, 2011 17:20
outputs the sha1 of the last commit, plus whether the repo is in a dirty state or not
#!/bin/bash
last=$(git log -1 --format="%h");
status=$(git status --porcelain | grep '^ M' | head -n 1)
if [ x"" = x"$status" ]; then
maybe_dirty=""
else
maybe_dirty="-dirty"
#!/usr/bin/env python
class foo(object):
bar = 9
def frob(bar):
bar = foo()
bar.bar = 1000000
f = foo()
@maw
maw / gist:500684
Created July 30, 2010 15:12
emacs git frontend
;; I never got comfortable with the existing emacs frontends to git.
;; So I wrote my own.
;; An awesome emacs git client!
(require 'eshell)
(defun awesome-git-client ()
"The best emacs git client!"
(interactive)
(eshell))
(defun my-eshell-path-setting-hook ()