Skip to content

Instantly share code, notes, and snippets.

---
layout: default
---
<section class="post">
<h2>{{ page.title }}</h2>
{{ content }}
<div class="flex flex-wrap w-100">
{% for project in site.projects %}
@tomcritchlow
tomcritchlow / bookmarklet.js
Created February 4, 2022 21:13
Gist code for Electric Tables V0.2.
// Convert this JS code into a bookmarklet using a tool like: http://js.do/blog/bookmarklets/
// Be sure to add your own macro_url and spreadsheet_url
var macro_url = "THIS IS YOUR MACRO URL";
var spreadsheet_id = "THIS IS YOUR SPREADSHEET URL";
var iframe = document.createElement("iframe");
iframe.setAttribute("name","dummyframe");
iframe.setAttribute("id","dummyframe");
iframe.setAttribute("style","display:none;");
javascript: (function() {
function removeEmpty(elem) {
var children = elem.children;
for (var i = 0; i < children.length; i++) {
if (children[i].textContent.trim() === '' && children[i].innerHTML.trim().length === 0) children[i].parentNode.removeChild(children[i]);
}
return elem;
}
function convertAbsolute(url) {
- Admin
- Client contact:
- Project start date:
- Fee:
- **Project Thesis**
- Thesis statement
- #todo
- Task 1
- Meeting Notes
- [[June 1st, 2020]] - Met with Person A, Person B
@tomcritchlow
tomcritchlow / book-urlnotes.json
Last active August 28, 2024 12:40
V0.1 for a library.json spec as outlined here: https://tomcritchlow.com/2020/04/15/library-json/
{
"title": "Tempo - timing, tactics and strategy in narrative-driven decision-making",
"id": null,
"author": "Venkatesh Rao",
"link": "https://www.amazon.com/Tempo-tactics-strategy-narrative-driven-decision-making-ebook/dp/B0069CHSLW",
"image": null,
"date_finished": "09/09/19",
"notes": [
"https://tomcritchlow.com/2020/04/13/tempo-notes-chapter-2/",
"https://tomcritchlow.com/2020/04/13/tempo-notes-chapter-1/"
@tomcritchlow
tomcritchlow / thread-embedder.js
Last active April 1, 2020 14:42
A bookmarklet to grab the URLs in a tweet thread and copy all the embed code to the clipboard
javascript: (function() {
var username = document.location.href.split("/")[3];
var urls = document.querySelectorAll("a");
var tweets = "<blockquote class='twitter-tweet' data-conversation='none'><a href='https://twitter.com"+document.location.href+"'></a></blockquote><script async src='https://platform.twitter.com/widgets.js' charset='utf-8'></script>\n\n";;
var count = 1;
urls.forEach(myFunction);
function myFunction(item, index) {
if(item.getAttribute("href").includes(username+"/status/") && !(item.getAttribute("href").includes("/retweets")) && !(item.getAttribute("href").includes("/likes"))){
I like this idea - that the most useful thing you need client input and co-creation on is the “base reality” - the “Who, What, Where”. For consultants coming in from the outside attempting to “solve problems” for clients the biggest flaw in generic strategies is not properly accounting for who is at the company, what we’re actually trying to solve and where this strategy will play out{% include tufte-sn.html id="just" content="Recall from <a href='https://tomcritchlow.com/2019/11/19/optimism-operating-system/'>chapter 2</a> - there is no 'just' in consulting - clients are ecosystems in balance..." %}.
@tomcritchlow
tomcritchlow / quote-text.js
Created June 19, 2019 18:46
A bookmarklet for turning selected text into a quote for markdown blogs
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
tomcritchlow / annotations.gs
Last active May 23, 2019 18:46
annotation-tracker-google-scripts
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
}