This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# models.py | |
class Link(models.Model): | |
..... | |
place = models.ManyToManyField("PlaceForLink", through="LinkPlace", related_name="link") | |
..... | |
place.hasplace_filter = True | |
# filters.py | |
class HasPlaceFilterSpec(FilterSpec): | |
def __init__(self, f, request, params, model, model_admin, field_path=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Pulseaudio volume control | |
class Pulse | |
attr_reader :volumes, :mutes | |
# Constructor | |
def initialize | |
dump = `pacmd dump`.lines | |
@volumes = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config for Nginx to act as a front-end for Riak | |
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc) | |
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_) | |
# Config is in /etc/nginx/sites-available/default or somewhere like that | |
# Set up load-balancing to send requests to all nodes in the Riak cluster | |
# Replace these IPs/ports with the locations of your Riak nodes | |
upstream riak_hosts { | |
server 127.0.0.1:8098; |