Skip to content

Instantly share code, notes, and snippets.

View Maxhodges's full-sized avatar
🐰
Rabbithole

Max Hodges Maxhodges

🐰
Rabbithole
View GitHub Profile
@Maxhodges
Maxhodges / site_directory
Last active December 22, 2015 05:08
JSON site_directory for Chrome/Opera Extension
{
"expires":"2013-09-13",
"sites":{
"premium": [
{
"match":"amazon.co.jp",
"price":"#pricediv.someclass",
"product":"#product_name"
},
{
@Maxhodges
Maxhodges / GetInvoiceByTag
Created December 18, 2013 07:11
Is it not possible to filter by "tag" using the API? I added tag name to my query, but the returned result set seems to ignore this parameter--its turns results regardless of if they match my specified tag or not.
Dim queries As New NameValueCollection
Dim proxy As New Ola.RestClient.Proxies.InvoiceProxy
Const SAASUDATEFORMAT As String = "dd-MM-yyyy"
queries.Add("transactionType", Ola.RestClient.Dto.TransactionType.Sale)
queries.Add("dateType", "transactiondate")
queries.Add("DateFrom", FromDate.ToString(SAASUDATEFORMAT))
queries.Add("DateTo", ToDate.ToString(SAASUDATEFORMAT))
queries.Add("paidStatus", "all")
queries.Add("fields", "InvoiceUid,InvoiceDate,FirstCreated,ModifiedDate,DueDate,InvoiceNumber,TotalAmountInclTax,AmountOwed")
@Maxhodges
Maxhodges / gist:8299904
Created January 7, 2014 14:17
MagentoServiceHelper
Public Class MagentoServiceHelper
Private _sessionId As String
Private _service As MagentoService
Public Sub New(ByVal sessionId)
_service = New MagentoService()
_sessionId = sessionId
// read values from reader object
int productID = -1;
while (reader.Read())
{
if (productID != System.Convert.ToInt32(reader["ProductID"])) {
// update productID
@Maxhodges
Maxhodges / get_options_by_sku.php
Last active August 29, 2015 14:01
attempt to get all products from Magento with Custom Options
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app('default');
$collectionSimple = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'simple'));
foreach ($collectionSimple as $_Simpleproduct) {
/**
* Load product by product id
@Maxhodges
Maxhodges / export_customers_from_orders.php
Last active August 29, 2015 14:01
attempt to get all customers which have one or more completed orders
<?php
require_once("app/Mage.php");
$app = Mage::app('');
$salesModel=Mage::getModel("sales/order");
$salesCollection = $salesModel->getCollection();
$fp = fopen('file2.csv', 'w');
foreach($salesCollection as $order)
@Maxhodges
Maxhodges / gist:1fe4dd4a62d104ac9cdd
Created May 27, 2014 17:19
order_increment_id is nothing in all records
Private Sub GetCustomersMagentoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GetCustomersMagentoToolStripMenuItem.Click
Dim mageService As New MagentoService(My.Settings.WRJshopAPIurl)
Dim ssid As String
Const CONNECTIONSTRING As String = "Data Source=queenofhearts\sqlexpress;Initial Catalog=Shopify;Integrated Security=SSPI"
ssid = mageService.login(My.Settings.magentoappuser, My.Settings.magentoapppassword)
Dim fromDate As Date = #1/27/2011#
Dim toDate As Date = #5/27/2014#
<div id="wufoo-m122o8ta0vq8dp8">
Fill out my <a href="https://whiterabbitjapan.wufoo.com/forms/m122o8ta0vq8dp8">online form</a>.
</div>
<div id="wuf-adv" style="font-family:inherit;font-size: small;color:#a7a7a7;text-align:center;display:block;">Online contact and registration forms from <a href="http://www.wufoo.com">Wufoo</a>.</div>
<script type="text/javascript">var m122o8ta0vq8dp8;(function(d, t) {
var s = d.createElement(t), options = {
'userName':'whiterabbitjapan',
'formHash':'m122o8ta0vq8dp8',
'autoResize':true,
'height':'460',
Private Sub GetCustomerData()
Dim fromDate As Date = #6/24/2010#
Dim toDate As Date = #5/27/2014# 'not used since API can't overlaped see bug http://www.magentocommerce.com/bug-tracking/issue?issue=8073
Dim salesOrderInvoices As salesOrderInvoiceEntity() = getSalesOrderInvoices(fromDate)
Dim orderIdValues = From a In salesOrderInvoices.AsEnumerable()
@Maxhodges
Maxhodges / gist:fa57501b4f2b65a78be4
Created June 7, 2014 01:25
messageformat example
<template name="Home">
<h2>{{mf 'Home.page_header' 'White Rabbit Express Landing Page'}}</h2>
<p>
{{#mf KEY='Home.intro_paragraph'}}
Nice explanation and layout of WRE services so that user understands the problems WRE solves and how WRE is different from everyone else.
{{/mf}}
</p>
<p>
{{#linkTo route='cart.new' class='btn btn-large btn-success'}}
{{mf 'Home.get_quote_button_title' 'Get a Quote'}} <i class="fa fa-angle-right"></i>