Skip to content

Instantly share code, notes, and snippets.

@3zzy
3zzy / gist:f6831eb33968ba3a53b7
Created February 12, 2015 06:04
Get category list from eBay
<?php
$endpoint = "https://api.ebay.com/ws/api.dll";
$api_dev_name = "secret";
$api_app_name = "secret";
$api_cert_name = "secret";
$auth_token = "token";
$headers = array(
@3zzy
3zzy / strpos_array.php
Created July 25, 2015 09:40
strpos multiple needles
function strpos_array($haystack, $needles, $offset=0) {
$matches = array();
//Avoid the obvious: when haystack or needles are empty, return no matches
if(empty($needles) || empty($haystack)) {
return $matches;
}
$haystack = (string)$haystack; //Pre-cast non-string haystacks
$haylen = strlen($haystack);
@3zzy
3zzy / curl_vs_getheaders.php
Created December 23, 2016 03:23
cURL vs get_headers() Speed Test
<?php
// Get headers for 100 unique random domains with get_headers() and cURL to determine which is faster.
/*
TL;DR -> cURL is significantly faster.
get_headers (GET) vs cURL:
Execution time : 139.95884609222 seconds
Execution time : 65.998840093613 seconds
#nginx config for apple pay domain verification
location /.well-known/apple-developer-merchantid-domain-association {
allow all;
autoindex on;
root /var/www/example.com/html;
add_header Content-Type text/plain;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@3zzy
3zzy / regex.js
Created May 31, 2019 02:42
Australian Address Regex
// Address Line 1:
(\b(?:(?!\s{2,}|\$|\:|\.\d).)*\s(?:Alley|Ally|Arcade|Arc|Avenue|Ave|Boulevard|Bvd|Bypass|Bypa|Circuit|Cct|Close|Cl|Corner|Crn|Court|Ct|Crescent|Cres|Cul-de-sac|Cds|Drive|Dr|Esplanade|Esp|Green|Grn|Grove|Gr|Highway|Hwy|Junction|Jnc|Lane|Lane|Link|Link|Mews|Mews|Parade|Pde|Place|Pl|Ridge|Rdge|Road|Rd|Square|Sq|Street|St|Terrace|Tce|ALLEY|ALLY|ARCADE|ARC|AVENUE|AVE|BOULEVARD|BVD|BYPASS|BYPA|CIRCUIT|CCT|CLOSE|CL|CORNER|CRN|COURT|CT|CRESCENT|CRES|CUL-DE-SAC|CDS|DRIVE|DR|ESPLANADE|ESP|GREEN|GRN|GROVE|GR|HIGHWAY|HWY|JUNCTION|JNC|LANE|LANE|LINK|LINK|MEWS|MEWS|PARADE|PDE|PLACE|PL|RIDGE|RDGE|ROAD|RD|SQUARE|SQ|STREET|ST|TERRACE|TCE))\s.*?(?=\s{2,})
// Address Line 2:
(\b(?:(?!\s{2,}).)*)\b(VIC|NSW|ACT|QLD|NT|SA|TAS|WA).?\s*(\b\d{4})
@3zzy
3zzy / tq_pilot.md
Last active June 28, 2020 00:29
TQ Pilot Meeting

Actions user can perform

- Registration
- Login
- Logout
- Password reset
- Email change
- Update Profile (currently only bank details)
- Create a request (withdrawal / deposit)
- View account (requests / transactions)
  • Contact Us