Skip to content

Instantly share code, notes, and snippets.

View JayGoldberg's full-sized avatar

Jay Goldberg JayGoldberg

View GitHub Profile
from google.appengine.api import images
from google.appengine.api import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
PAYLOAD_TEMPLATE = \
"""--==boundary\r
Content-Disposition: form-data; name="file"; filename="%s"\r
@mhawksey
mhawksey / gEVS.html
Created December 13, 2010 21:06
Example of using Google Spreadsheet and Visualization API as a multi question voting (clicker) system
<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>gEVS Using Google Spreadsheet and Visualization API as a voting system wrapper</title>
@andyj
andyj / excel2html.htm
Created September 16, 2011 04:13
Paste Excel in to HTML to create at <table>
<html>
<head>
<style>
*{
font-family: arial;
font-size: 11px;
}
table{
border-collapse: collapse;
border: 1px solid silver;
@JKirchartz
JKirchartz / html5 notepad
Created November 26, 2011 03:28
simple html5 Notepad, saves in localStorage, but you can only have one note at a time.
<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title>HTML5 notepad app</title>
<meta charset="utf-8">
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<style>
html,body{background:#FCFCFC;color:#444;height:100%;width:100%;margin:0;padding:0;}
#notepad{height:98%;width:98%;padding:1%;font-size:100%;line-height:125%;font-family:san-serif}
::selection{background:#7D7}
::-moz-selection{background:#7D7}
@ebouchut
ebouchut / LighttpdReverseProxyURLRewriting
Last active January 27, 2021 20:35
Lighttpd reverse-proxy to that matches an URL _and_ does URL rewriting #web #server #lighttpd
#server.modules += ( "mod_rewrite")
# Workaround to have a working reverse-proxy that matches an URL does URL rewriting in Ligghtpd.
#
# Ligtthpd 1.4.28 cannot perform both matching and URL rewriting at the same time.
# Therefore we need to define 2 proxies, one does the matching and bounce the request
# to the other one, in charge of rewriting the URL before proxying the request to the target server.
#
# More about this here:
# http://redmine.lighttpd.net/issues/164#note-9
@markcaudill
markcaudill / max_clients.sh
Created June 22, 2012 19:09
Determine the best Apache MaxClients parameter.
#!/bin/bash
# Copyright (c) 2012 Mark Caudill <mark@markcaudill.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@rcknr
rcknr / DriveUpload.gs
Last active February 15, 2023 20:06
This is a sample code to upload a PDF file to Google Drive with OCR in Apps Script. uploadPdfOcr function returns a File object. To run the code provide a developer key for an API Console project with Drive API service enabled.
function uploadPdfOcr() {
authorize();
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // <-- developer key
var file = UrlFetchApp.fetch("http://somewhere.com/path/file.pdf").getBlob();
var metadata = { title: file.getName() }
var params = {method:"post",
oAuthServiceName: "drive",
oAuthUseToken: "always",
contentType: "application/pdf",
contentLength: file.getBytes().length,
@goker-dev
goker-dev / index.html
Created January 5, 2013 19:56
A CodePen by goker cebeci. click to draw - HTML5 canvas drawing with mouse and touch events.
<canvas id="canvas"></canvas>
<div id="go">[ CLICK/TAP TO DRAW ]</div>
@johnschimmel
johnschimmel / image_to_blobstore.py
Created February 6, 2013 23:05
AppEngine upload, combine images and save to blob store. Python PIL and PIL paste function to give uploaded image a background
# -*- coding: utf-8 -*-
"""
A real simple app for using webapp2 with auth and session.
It just covers the basics. Creating a user, login, logout
and a decorator for protecting certain handlers.
Routes are setup in routes.py and added in main.py
"""
@ni-c
ni-c / watchdog.sh
Last active July 24, 2021 16:53
Raspberry PI Watchdog
sudo modprobe bcm2708_wdog
sudo vi /etc/modules # add line "bcm2708_wdog"
sudo apt-get install watchdog chkconfig
sudo chkconfig watchdog on
sudo service watchdog start
sudo vi /etc/watchdog.conf # enable line "watchdog-device = /dev/watchdog"