Skip to content

Instantly share code, notes, and snippets.

View hagsteel's full-sized avatar

Hagsteel hagsteel

View GitHub Profile
@hagsteel
hagsteel / theme.vim
Created October 7, 2020 08:07
Vim colours
set background=dark
highlight clear SignColumn
highlight ColorColumn ctermbg=234
highlight LineNr ctermbg=234 ctermfg=14
highlight CursorLineNr ctermbg=23 ctermfg=7
highlight CursorLine ctermbg=236
highlight StatusLineNC ctermbg=238 ctermfg=0
highlight StatusLine ctermbg=240 ctermfg=12
highlight IncSearch ctermbg=3 ctermfg=1

Keybase proof

I hereby claim:

  • I am hagsteel on github.
  • I am hagsteel (https://keybase.io/hagsteel) on keybase.
  • I have a public key ASBvPYkuI3pewP9w-BBoedpRWA-NyThE4ObU377XhcFu0go

To claim this, I am signing this object:

# Installing virtualenv and virtualenvwrapper
1. `sudo pip install virtualenv virtualenvwrapper`
2. `vim ~/.bash_profile`
then add the following to your bash profile:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Dev
source /usr/local/bin/virtualenvwrapper.sh
#!/bin/bash
[ -z "$VIRTUAL_ENV" ] && { echo "No virtual environment active"; exit 1; }
#let vepath="$VIRTUAL_ENV"
project_file="/.project"
fpath=$VIRTUAL_ENV$project_file
if [ -f "$fpath" ]
then

Keybase proof

I hereby claim:

  • I am jonashagstedt on github.
  • I am hagsteel (https://keybase.io/hagsteel) on keybase.
  • I have a public key whose fingerprint is 9C06 7B01 09D0 F7F5 EF01 ABC5 5A43 8D70 29B7 E803

To claim this, I am signing this object:

from django.db import connection
from swampdragon_auth.socketconnection import HttpDataConnection
from tornado import ioloop
class MysqlHeartbeatConnection(HttpDataConnection):
def _close_db_connection(self):
connection.close()
def on_open(self, request):
/*
* A rather simple way of testing out SwampDragon.
* Create a load of connections, connect, subscriber, update and count the number
* of published messages.
*
* SETUP:
* 1. npm install sockjs-client-node
* 2. curl https://raw.githubusercontent.com/jonashagstedt/swampdragon/master/swampdragon/static/swampdragon/js/swampdragon.js > swampdragon.js
* 3. Set router_name to the name of your router.
* 4. Change "sd.update_object(router_name, { value: val }, 'foo');" to call