Skip to content

Instantly share code, notes, and snippets.

class App
{
public static $Layout;
}
if(isset($_GET['AdminY']))
App::$Layout = new Shank_Layout_AdminY();
else
App::$Layout = new Shank_Layout_Canvas();
# vim:encoding=utf-8:ts=2:sw=2:expandtab
#
# Copyright 2010 AppCove, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
A ghist
Public Class SimpleMenu
Inherits List(Of Entry)
Public Class Entry
Public Property Label As String
Public Property Type As Types
Public Property href As String
Public Property id As String
Public Property onclick As String
@appcove
appcove / example.py
Created April 30, 2012 02:15
Examples of AppStruct DB Library
# vim:encoding=utf-8:ts=2:sw=2:expandtab
from AppStruct.Util import *
from AppStruct.WSGI.Util import ML
from HomeSchool import App
from datetime import date
from . import Student
from . import Subject
@appcove
appcove / Activity.py
Created September 12, 2012 01:53
Example database queries
# vim:encoding=utf-8:ts=2:sw=2:expandtab
from AppStruct.Util import *
from AppStruct.WSGI.Util import ML
from HomeSchool import App
from datetime import date
from . import Student
from . import Subject
@appcove
appcove / FlagType.py
Last active December 11, 2015 22:18
AppStruct Examples
FlagType
An extended `int` type which implements a very convenient mechansim for
defining flags and operating on them.
One of the primary uses is the convenient syntax:
flags = +front -back +side -top
Calling the unary operator (__pos__, __neg__) by prefixing one of the
@appcove
appcove / sessiondictproxy.py
Created March 4, 2013 07:50
Illustrating the power of python.
###############################################################################
class SessionDictProxy():
'''
Emulates an aadict() object, but all has/get/set/del operations convert to/from
json objects stored in Redis.
'''
def __init__(self, Token, RedisKey):
object.__setattr__(self, '_Token', Token)
# vim:encoding=utf-8:ts=2:sw=2:expandtab
from AppCove import *
import AppCove.Network
###############################################################################
@Expose
@appcove
appcove / Admin.py
Created September 13, 2013 05:08
Sample AppStruct.Base.V1 code
# vim:encoding=utf-8:ts=2:sw=2:expandtab
from Project import *
from AppStruct.Base.V1 import *
from AppStruct.Security import SHA1, RandomHex
###############################################################################
class Admin(metaclass=MetaRecord):