Skip to content

Instantly share code, notes, and snippets.

View henzard's full-sized avatar

Henzard Kruger henzard

View GitHub Profile
TrackingCategory tr = _api.TrackingCategories.Find().First();
_api.TrackingCategories[tr.Id].Add(new Option(){Name = "Blue"});
_api.PurchaseOrders.Create(new PurchaseOrder()
{
Contact = new Contact()
{
ContactNumber = "C0001"
},
Number = "4920249",
LineItems = new List<LineItem>()
{
new LineItem() {
_api.Files.ModifiedSince(new DateTime(2016, 04, 20)).Find();
invoices = Xero.Invoice.all(:where => {:type => 'ACCREC', :amount_due_is_not => 0})
$XeroOAuth->request('DELETE', $XeroOAuth->url('Items', 'core'), array(), $xml);
var invoice = Api.Create(new Invoice
{
Contact = new Contact { Name = "ABC Limited" },
Type = InvoiceType.AccountsReceivable,
LineItems = new List<LineItem>
{
new LineItem
{
AccountCode = "200",
Description = "Good value item",
List<Invoice> AllInvoices = new List<Invoice>();
List<Invoice> CurrentInvoices = new List<Invoice>();
int i = 1;
CurrentInvoices = _api.Invoices.Page(i).Find().OrderBy(e => e.DueDate).ToList();
while(CurrentInvoices != null)
{
AllInvoices.AddRange(CurrentInvoices);
i++;
CurrentInvoices = _api.Invoices.Page(i).Find().OrderBy(e => e.DueDate).ToList();
}
@henzard
henzard / 0_reuse_code.js
Created February 27, 2016 17:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
SELECT
t.NAME AS TableName,
i.name as indexName,
sum(p.rows) as RowCounts,
sum(a.total_pages) as TotalPages,
sum(a.used_pages) as UsedPages,
sum(a.data_pages) as DataPages,
(sum(a.total_pages) * 8) / 1024 as TotalSpaceMB,
(sum(a.used_pages) * 8) / 1024 as UsedSpaceMB,
(sum(a.data_pages) * 8) / 1024 as DataSpaceMB
ini_set('display_errors', true);
ini_set('error_reporting', E_ALL);
define('OUTMARKET_APIURL', 'https://api.omkt.co/icp');
// Load the OutMarket library
require_once('OutMarketApi.php');
// Give the API your information
OutMarketApi::getInstance()->setConfig(array(
'appId' => 'b6b7757e-fcdc-4891-88fd-9175c9174bd6',