Skip to content

Instantly share code, notes, and snippets.

wrought

Keybase proof

I hereby claim:

  • I am wrought on github.
  • I am wrought (https://keybase.io/wrought) on keybase.
  • I have a public key ASBMrLMofWBwHL-hYyD-8rwq30uAWpPeV-li8X8MpMXeTAo

To claim this, I am signing this object:

@wrought
wrought / gist:23e8090c2b74406e59a5
Last active August 29, 2015 14:07
to_unicode_or_bust.py
# Use this function to decode early
def to_unicode_or_bust( obj, encoding='utf-8-sig'):
if isinstance(obj, bytes):
obj = unicode(obj, encoding)
return obj
# use .encode('utf-8') to encode late
@wrought
wrought / consensus_david-graeber.txt
Created December 9, 2013 22:38
David Graeber on "Consensus"
CONSENSUS
There is a great deal of debate about whether consensus is even possible in larger groups, when it is appropriate for consensus-based groups to fall back on voting and to what purpose, but these debates are often marked by confusion as to what consensus actually means. Many for example assume, fairly stubbornly, that consensus process is simply a unanimous voting system—and then proceed to debate whether such a system “works,” presumably, as opposed to a system where all decisions take the form of a majority vote. From my perspective at least, such debates miss the point. The essence of consensus process is just that everyone should be able to weigh in equally on a decision, and no one should be bound by a decision they detest. In practice, this might be said to boil down to four principles:
• Everyone who feels they have something relevant to say about a proposal ought to have their perspectives carefully considered.
• Everyone who has strong concerns or objections should have those concer
@wrought
wrought / california_driver_handbook_bcicyle_snippets
Created December 6, 2013 01:30
California Driver Handbook - English 2013
Page 23
Right-of-Way Rules - "It is important to respect the right-of-way of others, especially pedestrians, motorcycle riders, and bicycle riders."
Pedestrians - "A pedestrian is a person on foot or who uses a conveyance such as roller skates, skateboard, etc., other than a bicycle. A pedestrian can also be a person with a disability using a tricycle, quadricycle, or wheelchair for transportation."
Page 35-36
Shared Roadway Bicycle Markings (Sharrows) - "Sharrows are used to remind motorists that bicycles are allowed to lawfully use this portion of a lane. Sharrows are used to assist bicyclists with positioning on a shared roadway. They also alert motorists of the location a bicyclist may occupy within the traveled roadway."
Bicycle Lanes - "A bicycle lane is a designated traffic lane for bicyclists marked by a solid white line, typically breaking into a dotted line edning before it reaches the corner."
- "Treat a bicycle lane the same as other traffic lanes"
- "[Vehicles] may park in a bicycle lane
@wrought
wrought / peoplesopen.net
Last active December 27, 2015 08:29
default apache config file for a local instance of peoplesopen.net as peoplesopen.loc. Also need to modify /etc/hosts file or DNS settings elsewhere.
<VirtualHost *:80>
ServerName peoplesopen.loc
ServerAlias www.peoplesopen.loc
ServerAdmin webmaster@localhost
DocumentRoot /var/www/peoplesopen.loc/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
@wrought
wrought / wordlists.html
Created October 21, 2013 22:02
Links to some word lists
<a name="resources">Resources used in compiling this wordlist</a></h2><a name="resources">
</a><ul><a name="resources">
</a><li><a name="resources"></a><a href="http://www.dcs.shef.ac.uk/research/ilash/Moby/">The Moby lexicon project</a> / Grady Ward <p>
</p></li><li><a href="http://ftp.digital.com/pub/misc/stolfi-wordlists/">The stolfi wordlists</a> / Jorge Stolfi and the original wordlist authors<br>
The wordlists in different languages were very useful in finding international words by intersection.<p>
</p></li><li><a href="ftp://ftp.ox.ac.uk/pub/wordlists">The wordlist collection at Oxford</a> / administered by Paul Leyland <p>
@wrought
wrought / open-source-anti-patterns-by-byran-cantrill.txt
Last active December 25, 2015 19:49
Notes on Bryan Cantrill's talk on Corporate Open Source Anti-Patterns
Found this very interesting talk by Bryan Cantrill https://en.wikipedia.org/wiki/Bryan_Cantrill on Corporate Open Source Anti-Patterns: Doing It Wrong (youtube https://www.youtube.com/watch?v=NhgXQFk9noI & slides http://www.slideshare.net/bcantrill/corporate-open-source-antipatterns). His slides are verbose, a little rough, and hard to understand, so I took some notes and made a summary, trying to simplify:
Side-note - He pushes a few debatable viewpoints (common flamebait such as GPL vs other licenses), so take these phrasings with a grain of salt (wink)
Summary
Inverted Thinking:
Misconception that the benefits of open source are assumed to be primary ($). In actuality, benefits are typically secondary, tertiary, and one should consider the cost of sharing is pretty much $0.
Wishful Thinking:
@wrought
wrought / .conkyrc
Created August 27, 2013 18:05
a config for crunchbang conky that displays more data, but keeps the keyboard shortcuts
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
@wrought
wrought / copyleft_all_wrongs_reversed.html
Last active December 19, 2015 03:29
Little javascript footer for informal rejection of copyright, as copyleft. Not a license, but a disclaimer, [read more](http://web.archive.org/web/20080101091757/http://www.iusmentis.com/copyright/allrightsreserved/)Replace $YOUR_NAME with the proper name for attribution, and $YOUR_URL with the proper URL for attribution.
<p><!--[if lte IE 8]><span style="filter: FlipH; -ms-filter: "FlipH"; display: inline-block;"><![endif]--><span style="-moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); display: inline-block;">&copy;</span><!--[if lte IE 8]></span><![endif]--> CopyLeft <a href="$YOUR_URL"><abbr>$YOUR_NAME</abbr></a>, All Wrongs Reversed, <script type="text/javascript">var d = new Date(); var year = d.getFullYear(); document.write(year);</script>.</p>
@wrought
wrought / pg_backup_git.sh
Last active December 15, 2015 21:59
backup postgres db with --inserts flag so it is easier to git track (instead of multiple snapshots, track snapshots with git)
#!/bin/bash
host="host"
user="pg_user"
port=1000
dbname="dbname"
# the "no-password" flag requires a .pgpass file with a password, to avoid being prompted for a password
pg_dump -h $host -U $user -p $port --no-password --inserts $dbname