This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="timezone" > | |
<option disabled selected style='display:none;'>Time Zone...</option> | |
<optgroup label="US (Common)"> | |
<option value="America/Puerto_Rico">Puerto Rico (Atlantic)</option> | |
<option value="America/New_York">New York (Eastern)</option> | |
<option value="America/Chicago">Chicago (Central)</option> | |
<option value="America/Denver">Denver (Mountain)</option> | |
<option value="America/Phoenix">Phoenix (MST)</option> | |
<option value="America/Los_Angeles">Los Angeles (Pacific)</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"group":"US (Common)", | |
"zones":[ | |
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"}, | |
{"value":"America/New_York","name":"New York (Eastern)"}, | |
{"value":"America/Chicago","name":"Chicago (Central)"}, | |
{"value":"America/Denver","name":"Denver (Mountain)"}, | |
{"value":"America/Phoenix","name":"Phoenix (MST)"}, | |
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"}, | |
{"value":"America/Anchorage","name":"Anchorage (Alaska)"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GAEHandler(logging.Handler): | |
""" | |
Logging handler for GAE DataStore | |
""" | |
def emit(self, record): | |
from google.appengine.ext import db | |
class Log(db.Model): | |
name = db.StringProperty() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.id = function() { | |
return $(this).attr('id'); | |
}; | |
$.fn.name = function() { | |
return $(this).attr('name'); | |
}; | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: window.location = `http://webcache.googleusercontent.com/search?q=cache:${window.location}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TAKEN FROM: https://stackoverflow.com/a/8407771/165673 | |
// IMPORTANT: This does NOT work with nested 'something[other]' type names. | |
// | |
// NOTES: | |
// - To avoid serializing certain input controls, tag them with '.no_serialize' class. | |
// - Will also ignore any inputs that don't have a name assigned. | |
// - Handles jQuery UI datepickers well. Doesn't care what format the datepicker uses. | |
// It will use whatever date format use pass as an option to .serialize_to_object(). | |
// | |
// REQUIRES: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
var og_site = document.querySelector("meta[property='og:site_name']") ? document.querySelector("meta[property='og:site_name']").getAttribute('content') : null; | |
var og_title = document.querySelector("meta[property='og:title']") ? document.querySelector("meta[property='og:title']").getAttribute('content') : null; | |
var channel = (og_site == 'YouTube' && document.querySelector("a.ytp-ce-channel-title")) ? document.querySelector("a.ytp-ce-channel-title").text : null; | |
var title = og_title ? `${og_title}` : document.title; | |
if(channel){title = `${title} - ${channel}`}; | |
if(og_site){title = `${title} - ${og_site}`}; | |
if (title) { | |
var re = /(\\|\/|:|\*|\?|\"|<|>|\|)/gi; | |
title = title.replace(re, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: var og_site = document.querySelector("meta[property='og:site_name']").getAttribute('content'); | |
var og_title = document.querySelector("meta[property='og:title']").getAttribute('content'); | |
var og_desc = document.querySelector("meta[property='og:description']").getAttribute('content').replace(/\s+/g, " "); | |
var channel = (og_site == 'YouTube') ? document.querySelector("a.ytp-ce-channel-title").text : null; | |
var title = og_title ? `${og_title}` : document.title; | |
if(channel){title = `${title} - ${channel}`}; | |
if(og_site){title = `${title} - ${og_site}`}; | |
if (title) { | |
var re = /(\\|\/|:|\*|\?|\"|<|>|\|)/gi; | |
title = title.replace(re, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FROM https://stackoverflow.com/a/9624997/165673 | |
javascript:if(!window.jQuery||confirm('Overwrite\x20current\x20version?\x20v'+jQuery.fn.jquery))(function(d,s){s=d.createElement('script');s.src='https://code.jquery.com/jquery.js';(d.head||d.documentElement).appendChild(s)})(document); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/svg_to_png', async function (req, res) { | |
let params = req.body | |
let image_url = 'https://s3.amazonaws.com/' + params.s3_bucket + '/' + params.s3_key | |
// STEP 1: Convert SVG to PNG: | |
var outputBuffer = svg2png.sync(params.svg_data, {}); | |
// STEP 2: Upload to S3: | |
let s3_params = { |
NewerOlder