Skip to content

Instantly share code, notes, and snippets.

@ahsquared
ahsquared / Google-Sheet-Form-Post.md
Created November 4, 2020 14:28 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.

Run example

You should be able to just open index.html in your browser and test locally.

" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
@ahsquared
ahsquared / jQuery-tap.js
Created January 23, 2019 16:00 — forked from subhaze/jQuery-tap.js
Probably a more sane way to do this, but, here's a x-device click/tap event; It works with event delegation as well.
jQuery.event.special.tap = {
add: function(handleObj){
var $this = $(this);
var touchMoved = false;
var touched = false;
var touchesHandler = function(e){
if(e.type === 'touchstart'){
touchMoved = false;
touched = true;
}else if(e.type === 'touchmove'){
@ahsquared
ahsquared / sequelize-schema-file-generator.js
Created July 15, 2018 02:01 — forked from francolaiuppa/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
'use strict';
//////////////////////////////////
// How to use?
// 1. Create `sequelize-schema-file-generator.js` in your app root
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders).
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports)
// 4. Run it with `node sequelize-schema-file-generator.js`
// 5. Review the generated migrations inside of the `migrations` folder.
//////////////////////////////////
@ahsquared
ahsquared / index.html
Last active August 29, 2015 14:22 — forked from konsumer/index.html
Your serial ports:
<ul id="ports"></ul>
<script>
require('serialport').list(function(err, ports){
document.getElementById('ports').innerHTML = ports.map(function(port){
return '<li>' + port.comName + '</li>';
}).join('');
});
</script>

The filter and zoom rules in the sample stylesheet above will apply a smoothing/blurring effect to text elements. In the sample stylesheet, these rules are applied to all headers, paragraphs, list items, and table cells, but in practice, you will want to tailor the application of the smoothing effect to only those elements rendering with significant aliasing.

Nota Bene: the filter appears to place an overflow: hidden-style block around the elements being smoothed, so do not apply these rules directly to elements that need to scroll, or which contain absolutely positioned elements that appear outside the boundaries of the element itself.

// Function for returning the user to any 'y' position in a Facebook app/tab. Uses jQuery animate, otherwise gracefully falls-back without it.
// Source[1]: http://stackoverflow.com/questions/7193425/how-do-you-animate-fb-canvas-scrollto
// Source[2]: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/
var scrollY = function (y) {
if (window.jQuery) {
FB.Canvas.getPageInfo (function (pageInfo) {
$({ y: pageInfo.scrollTop })
.animate({
y: y
(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");