Skip to content

Instantly share code, notes, and snippets.

View sharoonthomas's full-sized avatar

Sharoon Thomas sharoonthomas

View GitHub Profile
class Router(object):
def __init__(self):
self.methods = {}
def route(self, url):
def decorator(wrapped):
wrapped.__route_info__ = (self, url)
return wrapped
return decorator
def register(self, url, method):
self.methods[url] = method
from connection import NetSuiteConnect
from SuiteREST import SuiteRequest
from forms import send_error
class ExportFulfillments(object):
def __init__(self):
self.instance = NetSuiteConnect()
self.conn = self.instance.erp_connection()
Hola {{ nereid_user.display_name }},
<br/>
Thank you for registering for an Openlabs account.
<br/><br/>
To activate your account, please click the link <a href="{{ url_for('nereid.user.activate', user_id=nereid_user.id, activation_code=nereid_user.activation_code, _external=True) }}">here</a>
<br/>
Kind regards <br/>
<br/>
<br/>
Customer Support<br/>
def get_bins(self, cr, uid, bin_selection, storage_type, list_exclusions, qty_dict, context=None):
""" Find a list of locations based on user-defined criteria
:param :bin_selection Selection field, Bins with no assignment, bins with assignment only, or all
:param :storage_type Filter based on a specified storage type, i.e, overstock, backstock
:param :list_exclusions List of bin_ids to exclude from the search
:param :qty_dict Quantity in bin GT/LT threshold
@return list of bin_ids with travel sequence
"""
@sharoonthomas
sharoonthomas / pull_fulfil_activity_stream.py
Created November 20, 2018 19:22
Utilize Fulfil API to download complete Activity Stream Data history
import requests
import pandas as pd
from pandas.io.json import json_normalize
import numpy as np
import os
import json
from google.cloud import storage, bigquery
import datetime
import time
from multiprocessing.pool import ThreadPool
@sharoonthomas
sharoonthomas / change_db_owner.sh
Created June 11, 2012 16:34 — forked from gingerlime/change_db_owner.sh
Postgresql - Changing ownership on all tables
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto