Skip to content

Instantly share code, notes, and snippets.

@psbolden
psbolden / gist:51a418f50ed68b612236b9bca2da6c46
Created April 23, 2017 14:10
Blitline image grid / collage
{
"application_id":"YOUR_APP_ID",
"src":"https://s3.amazonaws.com/img.blitline/skysmall.jpg",
"functions":[
{
"name":"image_grid",
"params":{
"images": [
"https://s3.amazonaws.com/img.blitline/skysmall.jpg",
"https://unsplash.it/200/300/?random",
// use jQuery shipped with Uploadcare
$ = uploadcare.jQuery;
var widget = uploadcare.MultipleWidget('input');
// disable submit button
$('#submit').attr('disabled', true);
widget.onUploadComplete(function(info) {
// upload is complete
console.log(info);
@psbolden
psbolden / scale.html
Created May 26, 2017 15:28
Scale Image to fit on canvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<canvas id='cv'></canvas>
<button id='other'>other image</button>
{
"application_id":"YOUR_APP_ID",
"src":"http://cdn.blitline.com/filters/boys.jpeg",
"functions":[
{
"name":"convert_command",
"params":{
"-function":"polynomial 3.5,-5.05,2.05,0.3",
"-channel":"R"
},
@psbolden
psbolden / gist:54aa4f20f74f980854c3066a07d644fe
Created May 30, 2017 22:03
blitline convert command / color matrix
{
"application_id":"your app id",
"src":"http://cdn.blitline.com/filters/boys.jpeg",
"functions":[
{
"name":"convert_command",
"params":{
"-color-matrix" : "0.5 0 0 0 1 0 0 0 1"
},
"save":{
@psbolden
psbolden / gist:300b30cd1103e76f44981453f1ce69ce
Last active August 14, 2017 20:24
blitline convert / color matrix 2
{
"application_id":"yourappid",
"src":"http://cdn.blitline.com/filters/boys.jpeg",
"functions":[
{
"name":"convert_command",
"params":{
"-color-matrix" : ".6 0.3 -0.3 0 47 -0 .9 .2 0 -37 .2 -.1 .4 0 -7.5 0 0 0 1 0"
},
"save":{
@psbolden
psbolden / gist:d43f37a655a865f30635b9553cd39e64
Created May 30, 2017 22:37
Blitline Mutlistep Preprocess
{
"application_id": "your id",
"pre_process": [
{
"job": {
"pre_process": [
{
"job": {
@psbolden
psbolden / gist:72f1aaa2c134eab99df8ffe6e0b0051b
Created June 1, 2017 19:49
blitline convert command / magnify
//magnify doubles image size
{
"application_id":"your app id",
"src":"http://cdn.blitline.com/filters/boys.jpeg",
"functions":[
{
"name":"convert_command",
"params":{
"-magnify" : ""
@psbolden
psbolden / gist:4c7c0254bc5693bf8a271afea5ca4a1d
Last active June 1, 2017 20:05
Blitline convert command / resize
//-filter is not required
{
"application_id":"your app id",
"src":"https://s3.amazonaws.com/img.blitline/sky.jpg",
"functions":[
{
"name":"convert_command",
"params":{
"-resize" : "200%",
@psbolden
psbolden / gist:fccf39210879e81a6fe83ef418a12c52
Created June 26, 2017 18:44 — forked from bhurlow/gist:3861616
Better XML to JSON parsing for cdata
// Changes XML to JSON
// fixed some bugs from http://davidwalsh.name/convert-xml-json
// October 9, 2012
// Brian Hurlow
function xmlToJson(xml) {
// Create the return object
var obj = {};
// console.log(xml.nodeType, xml.nodeName );