Skip to content

Instantly share code, notes, and snippets.

Avatar

Sharoon Thomas sharoonthomas

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

Set the environment variables:

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

Install the dependencies

@sharoonthomas
sharoonthomas / move_inventory.py
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.
View move_inventory.py
import os
from fulfil_client import Client
client = Client(
os.environ['FULFIL_SUBDOMAIN'],
os.environ['FULFIL_API_KEY']
)
@sharoonthomas
sharoonthomas / get_inventory.py
Created Sep 21, 2016
Finding products and their inventory using Fulfil REST API (python example)
View get_inventory.py
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
sharoonthomas / README.md
Created Sep 8, 2016
Fulfil.IO Javascript/Node API
View README.md

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
sharoonthomas / get_shipments.py
Created Sep 2, 2016
Get shipments from fulfil using API
View get_shipments.py
import os
from datetime import date
from pprint import pprint
from fulfil_client import Client
client = Client('<subdomain>', os.environ['FULFIL_API_KEY'])
@sharoonthomas
sharoonthomas / date_time_tz_mess.py
Created Aug 19, 2016
Difference between using pytz.localize and datetime.replace
View date_time_tz_mess.py
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
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/test_account.py b/tests/test_account.py
index b0aef15..6651b9b 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -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
sharoonthomas / print_barcode.py
Created Apr 29, 2016
Print barcodes on a zebra printer
View print_barcode.py
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)
View create-ios-icon.sh
#!/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 ]
then
echo -e "This script requires one argument.\\ne.g. iOS_icon_maker.sh app_icon.png"
exit 1
fi
You can’t perform that action at this time.