Skip to content

Instantly share code, notes, and snippets.


Sharoon Thomas sharoonthomas

View GitHub Profile
sharoonthomas / freshplug.html
Created Oct 10, 2016
Fulfil.IO Freshdesk Plugin
View freshplug.html
<div id="fulfil_widget" class="widget" title="Fulfil.IO">
<img src="" height="40px" class="img img-responsive pull-right"/>
<div class="content" id="fulfil-content">Loading..</div>
<div class="error" id="fulfil-error"></div>
<script type="text/template" id="contact-template">
<h6>Found <%= _.keys(contacts).length %> contact(s)</h6>
sharoonthomas /
Last active Sep 29, 2016
Get addresses with contact information over api

Set the environment variables:

export FULFIL_SUBDOMAIN=your_subdomain
export FULFIL_API_KEY=a-long-api-key-which-is-secret

Install the dependencies

sharoonthomas /
Created Sep 23, 2016
An example script to move all the inventory from one location to another. Usually used when you are merging location for example.
import os
from fulfil_client import Client
client = Client(
sharoonthomas /
Created Sep 21, 2016
Finding products and their inventory using Fulfil REST API (python example)
import os
from pprint import pprint
from fulfil_client import Client
client = Client(os.environ['FULFIL_SUBDOMAIN'], os.environ['FULFIL_API_KEY'])
Product = client.model('product.product')
sharoonthomas /
Created Sep 8, 2016
Fulfil.IO Javascript/Node API

API Overview

Get a Fulfil client instance to .

var fulfil = require('fulfil');
var fulfilClient = require('fulfil').client('<subdomain>', '<api-key>');

Get a specific resource

sharoonthomas /
Created Sep 2, 2016
Get shipments from fulfil using API
import os
from datetime import date
from pprint import pprint
from fulfil_client import Client
client = Client('<subdomain>', os.environ['FULFIL_API_KEY'])
sharoonthomas /
Created Aug 19, 2016
Difference between using pytz.localize and datetime.replace
from datetime import date, time, datetime
import pytz
pacific = pytz.timezone('US/Pacific')
eastern = pytz.timezone('US/Eastern')
def get_naive_date_time():
date_start = date(2016, 9, 16)
time_start = time(10, 0)
sharoonthomas / account_balance_test.diff
Created Aug 16, 2016
Party payable and receivable seems to be incorrect if the balances are checked after closing fiscal year
View account_balance_test.diff
diff --git a/tests/ b/tests/
index b0aef15..6651b9b 100644
--- a/tests/
+++ b/tests/
@@ -735,6 +735,11 @@ class AccountTestCase(ModuleTestCase):
Journal = pool.get('account.journal')
Account = pool.get('account.account')
Move = pool.get('account.move')
+ Period = pool.get('account.period')
+ AccountType = pool.get('account.account.type')
sharoonthomas /
Created Apr 29, 2016
Print barcodes on a zebra printer
import sys
# needs pip install zebra
from zebra import zebra
# Replace the string below.
# You can get valid names from zebra().getqueues()
printer_name = "Zebra_Technologies_ZTC_GC420d__EPL__2"
z = zebra(printer_name)
#!/usr/bin/env bash
# This script assumes that ImageMagick is installed and the convert command is accessible via the $PATH variable
# Ensure that one argument has been passed in.
if [ ! "$#" -eq 1 ]
echo -e "This script requires one argument.\\ne.g. app_icon.png"
exit 1
You can’t perform that action at this time.