Skip to content

Instantly share code, notes, and snippets.

@psbolden
psbolden / gist:f95f53c462e81f14098c571f5278d60a
Created February 18, 2018 19:40
CSS : full page background image
html{
background: url(https://source.unsplash.com/daily) no-repeat center center fixed;
background-size: cover;
height: 100%;
overflow: hidden;
}
@psbolden
psbolden / gist:b2324b1fec5666668bab4ad49761039f
Created October 31, 2017 19:51
aws knox upload from url / set expiring url
var filename = "/imagename.jpg";
var url = "http://imageurl.jpg";
http.get(url , function(res){
var headers = {
'Content-Length': res.headers['content-length']
, 'Content-Type': res.headers['content-type']
};
client.putStream(res, filename, headers, function(err, res){
var expires = new Date();
expires.setMinutes(expires.getMinutes() + 10);
@psbolden
psbolden / xmlToJson.js
Created June 26, 2017 18:56 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
// Changes XML to JSON
// Modified version from here: http://davidwalsh.name/convert-xml-json
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
@psbolden
psbolden / xmlToJson.js
Last active June 26, 2017 18:52 — forked from feedmypixel/xmlToJson
Convert XML to JSON. This is a version that provides a JSON object without the attributes and places textNodes as values rather than an object with the textNode in it.
/**
* Originally from http://davidwalsh.name/convert-xml-json
* This is a version that provides a JSON object without the attributes and places textNodes as values
* rather than an object with the textNode in it.
* 27/11/2012
* Ben Chidgey
*
* @param xml
* @return {*}
*/
@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 );
@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: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:d43f37a655a865f30635b9553cd39e64
Created May 30, 2017 22:37
Blitline Mutlistep Preprocess
{
"application_id": "your id",
"pre_process": [
{
"job": {
"pre_process": [
{
"job": {
@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: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":{