Skip to content

Instantly share code, notes, and snippets.

@mcorrigan
mcorrigan / encoding_error_codes.yml
Created July 7, 2016 21:14
Encoding.com Error Codes
---
ECOM00001:
description: "The AWS Access Key Id you provided does not exist."
level: alert
ECOM00002:
description: "Overtime Limit Exceeded"
level: retry
ECOM00003:
description: "The specified bucket does not exist."
level: alert
@mcorrigan
mcorrigan / POST Request with File Resource
Last active October 10, 2022 10:42
Creating a POST request using file handlers for file content
<?php
# base code found here: http://stackoverflow.com/questions/3085990/post-a-file-string-using-curl-in-php
$delimiter = '----WebKitFormBoundary'.uniqid();
$data = create_post($delimiter, array(
'bingo' => 'yes'
), array(
'file' => array(
'filename' => 'data.txt',
@mcorrigan
mcorrigan / JavaScript Numeric Range
Created September 12, 2014 23:30
JavaScript Range Function
// something comparable to PHP range method. Supports numbers and letters.
function range(start, end, step) {
start || alert('must have 1+ params');
if (!end) {end = start; start = 0;}
var step = step || 1;
var range = [];
var is_num = !isNaN(start);
start = !is_num ? start.charCodeAt(0) : start;
end = !is_num ? end.charCodeAt(0) : end;
step = !is_num ? Math.max(Math.round(step), 1) : step;