Skip to content

Instantly share code, notes, and snippets.

View ohadperry's full-sized avatar

Ohad Perry ohadperry

View GitHub Profile
0xF87b23B08CCE057b4CFb7D462C00f180A4a8c055
0x269999b8dC883628ed7EE7aaAdD498e50C164905
0xd83e9efc1a7547f8fca40da0e22eac2bbfeb3071
from flask.ext.stormpath import login_required
from flask.ext.stormpath import StormpathManager
from flask.ext.stormpath import user
from flask.ext.stormpath import groups_required
from flask.ext.stormpath import groups_required
from flask.ext.stormpath import User as StormpathUser
from flask.ext.login import login_user
......
from environment import *
from helpers_had import GlobalHelper
class AuthenticationController():
def __init__(self, app):
# before every request, verify user is logged in
@app.before_request
def login_required():
# exclude 404 errors and static routes
import random # random password generate for auto new cloud user
class StormpathHelper(object):
def __init__(self, stormpath_manager, StormpathUserKlass):
self.stormpath_manager = stormpath_manager
self.main_cloud_directory = None
self.StormpathUser = StormpathUserKlass
# self.accounts = stormpath_manager.application.accounts
self.main_cloud_accounts = {}
@ohadperry
ohadperry / all classes
Last active December 14, 2015 10:18
Stack too deep
module Filter
def before_filter name
@@filter = name
end
def method_added name
return if @filtering # Don't add filters to original_ methods
return if @@filter == name # Don't filter filters
@filtering = true
@ohadperry
ohadperry / index.html
Created October 6, 2012 17:56
duda plugin html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Duda Mobile!</title>
<!--<link rel="stylesheet" href="assets/css/reset.css" type="text/css"/>-->
<link rel="stylesheet" href="assets/css/gallery.css" type="text/css"/>
<link rel="stylesheet" href="assets/js/bootstrap/css/bootstrap.min.css" type="text/css"/>
<link rel="stylesheet" href="assets/js/fancybox/source/jquery.fancybox.css?v=2.1.1" type="text/css" media="screen" />
@ohadperry
ohadperry / dudaGallery.js
Created October 6, 2012 17:53
first load
(function ($) {
var methods = {
init:function (myCase) {
var initServices = {
createNav:function () {
var enlr = $.dudaGlobal.settings.init.EnlargeMode;
var defnd = $.dudaGlobal.settings.init.DefinedMode;
var modeNavID = $.dudaGlobal.settings.internal.modeNavID;