Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block tomcritchlow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tomcritchlow / quote-text.js
Created Jun 19, 2019
A bookmarklet for turning selected text into a quote for markdown blogs
View quote-text.js
function getSelectionText() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
return text;
tomcritchlow /
Last active May 23, 2019
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var outputsheet = ss.getSheets()[0];
// get the existing IDs already in our spreadsheet in column A, sheet 1
var existingfeeddata = outputsheet.getRange("A:A").getValues();
var ids = [];
for(var i in existingfeeddata){
ids.push(existingfeeddata[i][0]); // convert 2d getvalues array to 1d array of IDs
tomcritchlow / hypothesis-gist.js
Last active Jun 6, 2019
Current customization for hypothesis annotation layer. See post here:
View hypothesis-gist.js
<script type="application/json" class="js-hypothesis-config">
"openSidebar": false,
"theme": "clean"
<script src="" async></script>
<script type="text/javascript">
View mathematical-shapes-rnn.txt
Parabier won fle
Hitesore curvet
Great Lcetux
Trocor plian stat
drapnage pysshedtiptated of Var1
View fbmessenger.css
.fbmessenger img{
filter: drop-shadow(2px 6px 4px rgba(0,0,0,.3));
View facebookmessenger.html
function OpenInNewTab() {
var screenwidth = screen.width-500;"", '_blank',"width=500,height=800,left="+screenwidth);
<a href="" target="_blank" onclick="OpenInNewTab();"> <!-- works for any facebook page -->
<div class="fbmessenger">
View instagram geolocation
function fetchInsta() {
var lat = ;
var long = ;
var apikey = ;
var url = ""+lat+"&lng="+long+"&distance=400&access_token="+apikey+"&count=100";
var result = UrlFetchApp.fetch(url);
var json = JSON.parse(result.getContentText());
tomcritchlow / pushstatecanonical.js
Created Feb 27, 2012
Proof of concept for pushtate + canonical tag
View pushstatecanonical.js
$(document).ready(function() {
if (canonical = $('link[rel=canonical]').attr('href'))
history.replaceState('', '', canonical);
tomcritchlow / Google Docs Script
Created Apr 5, 2011
The Google Spreadsheets Script Used To Call Social Media APIs
View Google Docs Script
function FBshares(url) {
var jsondata = UrlFetchApp.fetch(""+url);
var object = Utilities.jsonParse(jsondata.getContentText());
return object.shares;
function Tweets(url) {
var jsondata = UrlFetchApp.fetch(""+url);
var object = Utilities.jsonParse(jsondata.getContentText());
return object.count;
tomcritchlow /
Created Nov 9, 2010
The main code for 7books (
import cgi
import os
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.api import memcache
from google.appengine.api import urlfetch
You can’t perform that action at this time.