Skip to content

Instantly share code, notes, and snippets.

@tony
tony / xrandr.py
Created Feb 16, 2013
Displayport xrandr / xrandr.py / arandr issue. Base 0 not found. Fix is by Mihamina Rakotomandimby. More details in first comment below. This fixed displayport connections for me on Ubuntu 12.04 on a Thinkpad X230 with Minidock 3.
View xrandr.py
# ARandR -- Another XRandR GUI
# Copyright (C) 2008 -- 2011 chrysn <chrysn@fsfe.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@tony
tony / .gitignore
Last active Jun 25, 2020
Code explorer: An informal introduction to reST, docutils, sphinx and extensions for designers and new.
@tony
tony / readthedocs-uwsgi.rst
Last active Dec 29, 2015
Using readthedocs uwsgi local
View readthedocs-uwsgi.rst

If the virtualenv is in checkouts/readthedocs.org/.env (before the readthedocs module), from inside of checkouts:

$ uwsgi_python \
--chdir $PWD \
--processes 4 --threads 2 \
--socket 127.0.0.1:3031 --http-socket 127.0.0.1:3032 \
--stats 127.0.0.1:9191 \
@tony
tony / chineseradicals.py
Created Jan 23, 2014
Scrape Chinese Radical information from HTML tables on the internet using requests and pandas.
View chineseradicals.py
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""Pull Chinese Radical information from HTML tables on the internet.
:license: MIT License
:author: Tony Narlock
Requirements:
- lxml, html5lib, beautifulsoup4
@tony
tony / pillar settings.sls
Created Feb 12, 2014
php5 fcgi example (salt state + template config file)
View pillar settings.sls
username: tony
fullname: Tony N
mysql-version: 5.5
mysql-root-pw: root
{%- if grains['os'] == 'MacOS' %}
etc_dir: /opt/local/etc/
var_dir: /opt/local/var/
logs_dir: /opt/local/var/log/
@tony
tony / configure-ncmpcpp.sh
Created Apr 23, 2014
Configure vim, ncmpcpp
View configure-ncmpcpp.sh
#!/bin/bash
./configure --with-curl --with-taglib --enable-unicode --enable-outputs --enable-visualizer --enable-clock
@tony
tony / Application.root.js
Last active Aug 29, 2015 — forked from isochronous/Application.root.js
Updated for Backbone 1.1, Marionette 1.8.x. Update to use wreqr, bindTo -> listenTo
View Application.root.js
define([
"underscore",
"backbone",
"marionette",
"vent"
],
/**
* Creates the primary `Marionette.Application` object that runs the admin framework. Provides a central point
* from which all other sub-applications are started, shown, hidden, and stopped.
@tony
tony / compiling_ncmpcpp.rst
Last active Dec 30, 2020
Compiling ncmpcpp on debian jessie
View compiling_ncmpcpp.rst

Install boost libs

$ sudo apt-get install libboost-all-dev

Bug:

@tony
tony / messages_test_mixin.py
Last active Aug 29, 2015 — forked from ojii/messages_test_mixin.py
messages_request() accepts args, kwargs
View messages_test_mixin.py
from contextlib import contextmanager
from django.contrib.messages.storage.base import BaseStorage, Message
from django.test.client import RequestFactory
from django.utils.decorators import method_decorator
class TestMessagesBackend(BaseStorage):
def __init__(self, request, *args, **kwargs):
self._loaded_data = []
super(TestMessagesBackend, self).__init__(request, *args, **kwargs)
@tony
tony / docutils_to_gh.rst
Last active Aug 29, 2015
docutils migrations to github
View docutils_to_gh.rst