This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example MQLogHandler to emit log messages to an IronIO Queue | |
""" | |
import sys | |
import json | |
import logging | |
from iron_mq import * | |
logging.basicConfig(level=logging.INFO, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import csv | |
path = os.path.normpath(os.path.join(os.getcwd(), '..')) | |
sys.path.append(path) | |
path = os.path.normpath(os.path.join(os.getcwd(), '..','possync')) | |
sys.path.append(path) | |
from django.core.management import setup_environ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script will generate the necessary Javascript | |
to void CLOSED orders from a specific Register. The javascript | |
is intended to run in a Firebug console. | |
Nahnay Software, LLC | |
Makers of www.pos-sync.com | |
Authors: | |
------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var void_order = function(index){ | |
if (index < ids.length){ | |
var id = ids[index]; | |
console.log("(" + index + ") voiding order " + id); | |
$.ajax({ | |
type: "POST", | |
url: "/register_sale/void", | |
data: {id:id, return:null}, | |
success: function(data, stat, xhr){ | |
console.log("Success " + xhr.status); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids=["3b0e6b85-b0dc-2556-30e6-5b8f67d166b8","7deef2c5-c2c1-95d1-f17e-9c83e5f8169b"]; | |
var void_order = function(index){ | |
if (index < ids.length){ | |
var id = ids[index]; | |
console.log("(" + index + ") voiding order " + id); | |
$.ajax({ | |
type: "POST", | |
url: "/register_sale/void", | |
data: {id:id, return:null}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import auth | |
from django.core.exceptions import ImproperlyConfigured | |
from django.utils.functional import SimpleLazyObject | |
def get_user(request): | |
if request.session.has_key("_masq_user"): | |
return request.session["_masq_user"] | |
if not hasattr(request, '_cached_user'): | |
request._cached_user = auth.get_user(request) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@user_passes_test(lambda u: u.is_superuser) | |
def view_as_user(request, id): | |
""" | |
Allows a priveledged user to view the website as another without | |
logging in as that user | |
""" | |
log.info("Finding user %s" % id) | |
try: | |
user = User.objects.get(pk=id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import datetime | |
import calendar | |
import json | |
token = "------------" | |
project_id= "--------------" | |
iron_host = "worker-aws-us-east-1.iron.io/2/projects/%s" % project_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dhashpy | |
_dhash = None | |
_host = None | |
_port = None | |
class DHash(object): | |
"""Wrap the dhashpy to make the simple things simpler""" | |
def __init__(self, dhash): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
::Eagle Eye Networks Inc.::: | |
::Python screening:: | |
The following script is purposley written poorly. | |
Improve upon the code and explain your improvements. | |
The id_csv method must return a unicode string of | |
representation of a comma separated list of uuid's | |
""" |
OlderNewer