Skip to content

Instantly share code, notes, and snippets.

@johntynan
johntynan / CreateBookmarklet.html
Last active March 3, 2017 01:13 — forked from johnfmorton/CreateBookmarklet.html
Bookmarklet to auto-refresh any page at some point in the near future.
<!DOCTYPE html>
<html>
<head>
<title>Page Refresher</title>
</head>
<body>
<h1>Page Refresher</h1>
<p>Drag the link below to your toolbar to install the "page refresher" bookmarklet. Press the bookmarklet and you will be prompted for when you'd like the page you're on to be refreshed in your browser.</p>
<a href="javascript: (function () { var jsCode = document.createElement('script'); jsCode.setAttribute('src', 'https://gist.githubusercontent.com/johntynan/fb858830754b424b222a28c536f8505e/raw/f80b30fcb17daf6452a4292f2e2b88eb478174b2/pagerefresher.js'); document.body.appendChild(jsCode); }());">Refresher</a>
<!DOCTYPE html>
<html>
<body>
<!-- ++Begin GSpreadsheets Map Wizard Generated Code++ -->
<div style="width:575px; font-family:Arial,
sans-serif; font-size:11px; border:1px solid black">
<table id="cm_mapTABLE"> <tbody> <tr id="cm_mapTR">
@johntynan
johntynan / gist:5032921
Last active December 14, 2015 05:08
Getting started with nprapps / app-template
cd ~/
mkdir webdev
cd webdev
mkdir nprapps
cd nprapps
git clone git@github.com:nprapps/app-template.git $NEW_PROJECT_NAME
cd $NEW_PROJECT_NAME
ls
#looks good!
<html><head><base href="http://mozillapopcorn.org:8888/templates/walking/">
<title>Popcorn Maker: walking tour</title>
<style type="text/css">
html, body {
width: 100%;
padding: 0;
@johntynan
johntynan / ontimedcomments.js
Created April 14, 2012 08:51 — forked from leemartin/ontimedcomments.js
OnTimedComments Example
SC.initialize({
client_id: "YOUR_CLIENT_ID"
});
SC.whenStreamingReady(function() {
SC.stream(TRACK_ID, {
ontimedcomments: function(comments) {
var comment, _i, _len;
for (_i = 0, _len = comments.length; _i < _len; _i++) {
@johntynan
johntynan / gist:1861386
Created February 19, 2012 00:14
Error: syntax error
Error: syntax error
Source File: ../popcorn/theworldiswrappedinrain/
Line: 1, Column: 1
Source Code:
[{"id":42187654,"created_at":"2012/02/11 13:39:06 +0000","user_id":25255,"track_id":35420582,"timestamp":199124,"body":"@ccarrieres: Thanks Christophe. Glad you liked it!","uri":"http://api.soundcloud.com/comments/42187654","user":{"id":25255,"permalink":"johntynan","username":"johntynan","uri":"http://api.soundcloud.com/users/25255","permalink_url":"http://soundcloud.com/johntynan","avatar_url":"http://i1.sndcdn.com/avatars-000009966090-88q7m0-large.jpg?c7b914c"}},{"id":41809379,"created_at":"2012/02/08 21:28:52 +0000","user_id":19182,"track_id":35420582,"timestamp":199124,"body":"you were inspired very nice !","uri":"http://api.soundcloud.com/comments/41809379","user":{"id":19182,"permalink":"ccarrieres","username":"ccarrieres","uri":"http://api.soundcloud.com/users/19182","permalink_url":"http://soundcloud.com/ccarrieres","avatar_url":"http://i1.sndcdn.com/avatars-000001160559-rpvtg9-large.jpg?c7b914c"}}]
@johntynan
johntynan / gist:1861335
Created February 18, 2012 23:45
Error: syntax error Line: 1, Column: 1
Error: syntax error
../players/soundcloud/popcorn.soundcloud.html
Line: 1, Column: 1
Source Code:
[{"id":43039390,"created_at":"2012/02/16 23:50:44 +0000","user_id":987088,"track_id":293,"timestamp":76508,"body":"@she_burns_like_the_sun: nigga this shit aint too choppped up, prime incisions ","uri":"http://api.soundcloud.com/comments/43039390","user":{"id":987088,"permalink":"loosenoise","username":"loosenoises","uri":"http://api.soundcloud.com/users/987088","permalink_url":"http://soundcloud.com/loosenoise","avatar_url":"http://i1.sndcdn.com/avatars-000002922286-lzp809-large.jpg?c7b914c"}},{"id":42352677,"created_at":"2012/02/12 17:57:39 +0000","user_id":2670565,"track_id":293,"timestamp":52069,"body":"@sinecera-1: Nice Style we can mix \u2026. Check My Realistic Poetry Vocals out tell me what you think \u2026 http://soundcloud.com/delano-johnson/dj-mix-this-roses-never-stink","uri":"http://api.soundcloud.com/comments/42352677","user":{"id":2670565,"permalink":"delano-johnson","username":"Delano Johnson","ur
@johntynan
johntynan / gist:1384892
Created November 22, 2011 04:28
Removing @cache() decorator from thank_yous, producer_messages, and header in refresh.py due to PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed
Traceback (most recent call last):
File "/home/john/webdev/web2py_pledgedrivetracker/gluon/restricted.py", line 194, in restricted
exec ccode in environment
File "/home/john/webdev/web2py_pledgedrivetracker/applications/pledgedrives/controllers/refresh.py:thank_yous", line 293, in <module>
File "/home/john/webdev/web2py_pledgedrivetracker/gluon/globals.py", line 149, in <lambda>
self._caller = lambda f: f()
File "/home/john/webdev/web2py_pledgedrivetracker/gluon/cache.py", line 424, in action
return cache_model(key, func, time_expire)
File "/home/john/webdev/web2py_pledgedrivetracker/gluon/contrib/gae_memcache.py", line 39, in __call__
self.set(key, (time.time(), value))
@johntynan
johntynan / moznewslab256-johntynan
Created July 24, 2011 19:17
MozNewsLab256-JohnTynan
Create a tool to create "rich geolocated points" within an audio or video story. These points will be displayed on a map as well as along a timeline within a media player. These points can include images, text, tweets or other media types.
@johntynan
johntynan / popcorn_styler_js_02.js
Created July 24, 2011 12:58
Popcorn.styler.js Snippet 2
.styler({
start: 0, // seconds
end: 10, // seconds
color: 'Black',
target: 'footnotediv'
})
.styler({
start: 10, // seconds
end: 20, // seconds
color: 'Black',