Skip to content

Instantly share code, notes, and snippets.

const el = document.querySelector(".item");
let isResizing = false;
el.addEventListener("mousedown", mousedown);
function mousedown(e) {
window.addEventListener("mousemove", mousemove);
window.addEventListener("mouseup", mouseup);
@christierney402
christierney402 / S3Wrapper.cfc
Last active February 9, 2019 07:30
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@pies
pies / ExcelFormulas.js
Created November 29, 2012 04:55
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
@sirkirby
sirkirby / VEAPI_VIN_jQuery.js
Created October 22, 2012 21:54
RyanTech VIN Explosion API Decode VIN w/ jQuery
// using jQuery and jQuery-base64 https://github.com/carlo/jquery-base64
var creds = "Basic " + $.base64.encode("username:password");
$.ajax({
url: "http://vinexplosion.com/api/vin/decode/3GYFNAE36CS509361/?fuzzy=true",
dataType: "jsonp",
beforeSend: function (req) {
req.setRequestHeader("Authorization", creds);
req.setRequestHeader("Accept", "application/json");
},
success: function(data, status) {
@saikat
saikat / gist:1084146
Created July 15, 2011 05:43
Stripe sample checkout form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">