Skip to content

Instantly share code, notes, and snippets.

View alex-laties's full-sized avatar

Alexander Laties alex-laties

  • Google
  • New York, New York
View GitHub Profile
@alex-laties
alex-laties / djangosession.py
Created December 17, 2012 03:06
Accessing django sessions via a WSGI Middleware. Can be used in any python web stack that conforms to the PEP 333 WSGI specification. This includes bottle.
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' #not using env.put as that does not execute immediately
from django.conf import settings
SessionStore = __import__(settings.SESSION_ENGINE, fromlist=['']).SessionStore
class DjangoSessionWSGIMiddleware(object):
transform = false #doesn't transform output of anything above in the stack
def __init__(self, app):
self.app = app
@alex-laties
alex-laties / keybase.md
Created July 16, 2016 22:44
keybase.md

Keybase proof

I hereby claim:

  • I am alex-laties on github.
  • I am alexlaties (https://keybase.io/alexlaties) on keybase.
  • I have a public key whose fingerprint is D6F1 EAAC 9661 AC9A AB31 C48D EB9F 87A0 34F8 4699

To claim this, I am signing this object:

CMake Error at common/CMakeLists.txt:76 (create_directory_groups):
Unknown CMake command "create_directory_groups".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
javascript:(function()%7Bfunction%20c()%7Bvar%20e%3Ddocument.createElement(%22link%22)%3Be.setAttribute(%22type%22,%22text/css%22)%3Be.setAttribute(%22rel%22,%22stylesheet%22)%3Be.setAttribute(%22href%22,f)%3Be.setAttribute(%22class%22,l)%3Bdocument.body.appendChild(e)%7Dfunction%20h()%7Bvar%20e%3Ddocument.getElementsByClassName(l)%3Bfor(var%20t%3D0%3Bt%3Ce.length%3Bt%2B%2B)%7Bdocument.body.removeChild(e%5Bt%5D)%7D%7Dfunction%20p()%7Bvar%20e%3Ddocument.createElement(%22div%22)%3Be.setAttribute(%22class%22,a)%3Bdocument.body.appendChild(e)%3BsetTimeout(function()%7Bdocument.body.removeChild(e)%7D,100)%7Dfunction%20d(e)%7Breturn%7Bheight:e.offsetHeight,width:e.offsetWidth%7D%7Dfunction%20v(i)%7Bvar%20s%3Dd(i)%3Breturn%20s.height%3Ee%26%26s.height%3Cn%26%26s.width%3Et%26%26s.width%3Cr%7Dfunction%20m(e)%7Bvar%20t%3De%3Bvar%20n%3D0%3Bwhile(!!t)%7Bn%2B%3Dt.offsetTop%3Bt%3Dt.offsetParent%7Dreturn%20n%7Dfunction%20g()%7Bvar%20e%3Ddocument.documentElement%3Bif(!!window.innerWidth)%7Breturn%20window.innerHeight%7Delse%
def decode_byte(b):
b = ord(b)
b = chr(((b & 3) << 6) + (b >> 2))
return b
import urllib2
import json
from supervisor import childutils
import sys
import socket
class PagerDutyNotifier(object):
def __init__(self, pd_service_key):
self.pd_service_key = pd_service_key
font:
family: serif
weight: bold
size: 1.2em
/Users/ag/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/attribute_methods/write.rb:14: syntax error, unexpected '?', expecting ';' or '\n'
def is_professor?=(new_value); write_attribute...
^
/Users/ag/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/attribute_methods/write.rb:14: syntax error, unexpected keyword_end, expecting $end
...is_professor?', new_value); end
<div class="modal-body">
<form class="form-search" id="search">
<input text="text" class="input-large search-query">
<a href="#" class="btn btn-primary">Search</a>
<div class="hidden-submit">
<input type="submit" tabindex="-1">
</div>
</form>
</div>
@alex-laties
alex-laties / gist:1735434
Created February 4, 2012 04:53
Error log for current Konsole MacPort package (konsole 4.8.0)
:info:configure -- Found Qt-Version 4.7.4
:info:configure -- -> QT_QMAKE_EXECUTABLE is /opt/local/bin/qmake
:info:configure -- -> QT_INCLUDE_DIR is /opt/local/include
:info:configure -- -> QT_QTCORE_INCLUDE_DIR is /opt/local/include/QtCore
:info:configure -- -> QT_BINARY_DIR is /opt/local/bin
:info:configure -- -> QT_LIBRARY_DIR is /opt/local/lib
:info:configure -- -> QT_PLUGINS_DIR is /opt/local/share/qt4/plugins
:info:configure -- -> QT_MKSPECS_DIR is /opt/local/share/qt4/mkspecs
:info:configure -- Phonon Version: 4.4.2
:info:configure -- Found KDE 4.7 include dir: /opt/local/include