Skip to content

Instantly share code, notes, and snippets.

@dolph
dolph / div.html
Created September 4, 2012 15:35
(blog) embedding github gists on blogger
<div class="gistLoad" data-id="3622487" id="gist-3622487">Loading...</div>
# This is as close as
# you will get to a block
# commented Haiku.
>>> import base36
>>> print base36.encode(13368)
abc
>>> print base36.decode('abc')
13368
def slugify(s):
"""
Simplifies ugly strings into something URL-friendly.
>>> print slugify("[Some] _ Article's Title--")
some-articles-title
"""
# "[Some] _ Article's Title--"
@dolph
dolph / gist:3650871
Created September 6, 2012 03:37
better cut copy paste
nmap <C-v> "+gP
imap <C-v> <ESC>"+gpi
vmap <C-v> c<ESC>"+gph
vmap <C-c> "+y
@dolph
dolph / xorg.conf
Created September 10, 2012 20:27
2x 1080p monitors in portrait (nouveau)
Section "ServerLayout"
Identifier "Dual 1080p Portraits"
Screen 0 "Screen" 0 0
InputDevice "Mouse" "CorePointer"
InputDevice "Keyboard" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
@dolph
dolph / terminalrc
Created September 17, 2012 17:15
XFCE4 Terminal Config w/ Solarized (Dark) Theme
[Configuration]
ColorCursor=#9393a1a1a1a1
ColorForeground=#FDFDF6F6E3E3
ColorPalette2=#dcdc32322f2f
ColorPalette3=#858599990000
ColorPalette4=#b5b589890000
ColorPalette5=#26268ae0d2d2
ColorPalette6=#d3d336368282
ColorPalette7=#29efa1479755
ColorPalette8=#eeeee8e8d5d5
@dolph
dolph / keystone.conf
Created April 30, 2013 15:31
keystone LDAP config for AD
[ldap]
url = ldap://10.181.143.15
user = CN=Administrator,CN=Users,DC=rcbops,DC=me
password = hzQpjSTaS5Fg
suffix = DC=rcbops,DC=me
use_dumb_member = True
dumb_member = CN=Administrator,CN=Users,DC=rcbops,DC=me
user_tree_dn = CN=Users,DC=rcbops,DC=me
user_objectclass = person
user_id_attribute = cn
@dolph
dolph / rm_pyc
Last active December 17, 2015 02:09
Recursively removes python bytecode files from the current working directory.
#!/bin/bash
find . -name "*.pyc" -delete
POST /role_assignments
{"role_assignment": {
"user" {
"id": "1"
},
"role": {
"id": "2"
},
"scope": {