Skip to content

Instantly share code, notes, and snippets.

View Eugeny's full-sized avatar

Eugene Eugeny

View GitHub Profile
var oauthPercentEncode = (function(){
var escapeChars = "!*'();:@&=+$,/?%#[]",
matchChars = new RegExp( "([\\" + ( escapeChars.split('').join('\\')) + "])", "gi");
return function( p ) {
return p.replace( matchChars, function( char ) {
return '%' + ( "" + char ).charCodeAt(0).toString(16).toUpperCase();
})
}
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
GOOGLE_CLIENT_ID = '828226820573-...'
GOOGLE_CLIENT_SECRET = 'GjVcxp...'
GOOGLE_OAUTH_URL = 'https://accounts.google.com/o/oauth2/auth?scope=https%%3A%%2F%%2Fwww.googleapis.com%%2Fauth%%2Fuserinfo.email+https%%3A%%2F%%2Fwww.googleapis.com%%2Fauth%%2Fuserinfo.profile&state=&redirect_uri=%s&response_type=code&client_id=%s' # add gmail scopes...?
GOOGLE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
GOOGLE_REDIRECT_URL = 'http://%s/auth/google/callback' % HOST
...
urlpatterns = patterns(...,
authmodulelist="authuserdb authpam"
daemons=5
authdaemonvar=/var/spool/authdaemon/socket
DEBUG_LOGIN=0
DEFAULTOPTIONS=""
#!/usr/bin/env python
import pyltfs2
import sys
url='mysql+mysqlconnector://root:123@localhost/syslink_tapelibrary'
ltfs = pyltfs2.LTFS(url)
ltfs.delete_tape(name=sys.argv(1))
from reconfigure.items.bound import BoundData
from reconfigure.configs.base import Reconfig
from reconfigure.parsers import IniFileParser
from reconfigure.builders import BoundBuilder
class OperaData (BoundData):
pass
from ajenti.api import *
from ajenti.plugins.main.api import SectionPlugin
from ajenti.ui import on
from ajenti.ui.binder import Binder
@plugin
class GLSlideShowPrefs (SectionPlugin):
default_classconfig = {
'option_1_enable': True # etc
➜ glslideshow_flags ls -l
total 12
lrwxrwxrwx 1 eugene eugene 49 Feb 18 11:20 glslideshow_flags.py -> /usr/share/pyshared/ajenti/plugins/hosts/hosts.py
-rw-r--r-- 1 eugene eugene 1967 Feb 18 11:28 glslideshow_flags.pyc
lrwxrwxrwx 1 eugene eugene 52 Feb 18 11:20 __init__.py -> /usr/share/pyshared/ajenti/plugins/hosts/__init__.py
-rw-r--r-- 1 eugene eugene 570 Feb 18 11:28 __init__.pyc
drwxr-xr-x 2 eugene eugene 4096 Feb 18 11:20 layout
class Option (object):
def __init__(self, value):
self.value = value
...in plugin:
def init(self):
....
self.binder = Binder(None, self)
from ajenti.ui import UIElement
print UIElement.get_classes()
print sorted(list(set([x.typeid for x in UIElement.get_classes()])))