Skip to content

Instantly share code, notes, and snippets.

Alan K. alankimo

Block or report user

Report or block alankimo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alankimo
alankimo / imgURL.js
Created Jan 18, 2019 — forked from DanWebb/imgURL.js
Specify a size for a Shopify image asset url. Equivalent to the liquid image size filter: `{{ image | img_url: "medium" }}`
View imgURL.js
String.prototype.imgURL = function(size) {
// remove any current image size then add the new image size
return this
.replace(/_(pico|icon|thumb|small|compact|medium|large|grande|original|1024x1024|2048x2048|master)+\./g, '.')
.replace(/\.jpg|\.png|\.gif|\.jpeg/g, function(match) {
return '_'+size+match;
})
;
};
@alankimo
alankimo / getOrder_Shopify.php
Created Sep 28, 2017
Eso es un ejemplo de como mandar un request sin JSON concatenado los varoles en la URL mediante GET.
View getOrder_Shopify.php
<? php
function orderStatus($data_0, $data_1, $data_2, $data_3, $data_4, $data_5, $data_6, $data_7, $data_8, $data_9) {
$payload = 'x_account_id=' . $data_1 . '&x_reference=' . $data_2 . '&x_currency=' . $data_3 . '&x_test=' . $data_4 . '&x_amount=' . $data_5 . '&x_gateway_reference=' . $data_6 . '&x_timestamp=' . $data_7 . '&x_result=' . $data_8 . '&x_signature=' . $data_9;
$session = curl_init();
curl_setopt($session, CURLOPT_URL, $data_0); // $putUrl
curl_setopt($session, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($session, CURLOPT_TIMEOUT, 30);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
View updateCustomer_Shopify.php
<?php
function updateCustomer($api_url, $api_key, $api_pswd, $customer_id, $billing_agreement, $tags_default) {
$baseUrl = "https://".$api_key.":".$api_pswd."@".$api_url."/admin/";
$tagsFix = $tags_default . ', 20XX-' . $billing_agreement;
//Set up JSON payload
$payload = array(
"customer" => array(
'id' => $customer_id,
You can’t perform that action at this time.