Skip to content

Instantly share code, notes, and snippets.

@ka7eh
ka7eh / leaflet_to_pdf.html
Created April 12, 2016 16:55
An example for converting Leaflet maps to PDF using leaflet-image and jsPDF
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css"/>
<style>
#mapid{
height: 480px;
}
#download {
position:absolute;
@thedewpoint
thedewpoint / resize_and_upload_task.js
Created April 24, 2016 20:04
Image manipulation and upload to S3
/**
* Created by daniel on 9/29/2015.
*/
var AWS = require('aws-sdk');
AWS.config.update({accessKeyId: 'ID', secretAccessKey: 'KEY'});
AWS.config.update({region: 'us-east-1'});
var s3 = new AWS.S3();
var fileType = require('file-type');
var lwip = require('lwip');
var uuid = require('node-uuid');
@sawantuday
sawantuday / postData.php
Created May 9, 2016 09:53
Extract raw data from POST request.
<?php
$webhookContent = "";
$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
$webhookContent .= fread($webhook, 4096);
}
fclose($webhook);
echo $webhookContent;
@wboykinm
wboykinm / index.html
Created May 24, 2016 00:37 — forked from pgiraud/index.html
D3js save SVG file
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@dvnkshl
dvnkshl / example-basic.html
Last active October 6, 2019 05:03
Commerce.js Checkout Example (Basic)
<!---
This is a basic javascript checkout built with Commerce.js (http://commercejs.com).
Tutorial: Checkout Tutorial (Basic) - http://commerce.js.com/docs/overview/checkout-tutorial/
!-->
<html>
<head>
<title>Checkout Tutorial (Basic)</title>
<meta charset="utf-8">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.7.2/jquery.serializejson.js"></script>
@dvnkshl
dvnkshl / example-advanced.html
Last active June 10, 2019 02:28
Commerce.js Checkout (Advanced)
<!---
This is a advanced javascript checkout built with Commerce.js (http://commercejs.com).
Tutorial: Checkout Tutorial (Advanced) - http://commerce.js.com/docs/overview/checkout-tutorial-advanced/
!-->
<html>
<head>
<title>Checkout Tutorial (Advanced)</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.7.2/jquery.serializejson.js"></script>
<script type="text/javascript" src="https://cdn.chec.io/v1/commerce.js"></script>
anonymous
anonymous / index.html
Created September 12, 2016 14:44
JS Bin // source http://jsbin.com/wizaxe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
img{
max-width: 100%
}
anonymous
anonymous / index.html
Created September 12, 2016 14:45
JS Bin // source http://jsbin.com/limipe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.0/mustache.min.js"></script>
<style id="jsbin-css">
img{
anonymous
anonymous / index.html
Created September 12, 2016 14:53
JS Bin // source http://jsbin.com/himeneb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
<style id="jsbin-css">
/* Hide un-compiled mustache bindings
@bbrewer97202
bbrewer97202 / index.js
Created October 20, 2016 17:15
Graphicsmagick gm convert svg string buffer to sized jpg with 300 DPI setting
var gm = require('gm');
var source = '<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 2550 3300" enable-background="new 0 0 2550 3300" xml:space="preserve"><g><path fill="#53381A" stroke="#1C1308" d="M807.6,1092.5L527.3,1067c-636.9-25.5-509.5,0-458.6,509.5c51,203.8,0,331.2,254.8,331.2 L807.6,1092.5z"/><path fill="#8A5B28" stroke="#1C1308" d="M909.5,1143.5H629.2c-636.9-25.5-509.5,0-458.6,509.5c51,203.8,25.5,305.7,305.7,229.3 L909.5,1143.5z"/><path fill="#454F2E" stroke="#1C1308" d="M807.6,990.6c127.4-254.8,76.4-305.7,458.6-254.8c509.5,127.4,509.5,152.9,891.6,152.9 c254.8,25.5,509.5,101.9,254.8,407.6l-280.2,509.5H450.9L807.6,990.6z"/><path fill="#76894C" stroke="#1C1308" d="M323.5,1703.9v178.3l1146.4,458.6v-178.3L323.5,1703.9z M807.6,990.6 c127.4-254.8,76.4-305.7,382.1-203.8c509.5,152.9,254.8,152.9,789.7,152.9c254.8,25.5,458.6,101.9,254.8,407.6L1954,1856.8 L527.3,1627.5L807.6,990.6z"/