Skip to content

Instantly share code, notes, and snippets.

@sirtimbly
sirtimbly / sam-snippet-1.ts
Created November 29, 2017 16:06
sam-snippet-1.ts
TodoList: (props: TodoListProps) => {
return h("ul.all-todos", props.list.map((item: string) => {
return h("input.todo", {
type: "checkbox",
value: item.id,
checked: item.done,
classes: { 'strikethrough': item.done },
onchange: this.actions.changeTodoItem,
});
@sirtimbly
sirtimbly / accessibility.md
Created June 26, 2017 18:00
Accessibility Best Practices

Accessibility

Not all of our users will have the same abilities that we assume. There are several ways we can improve our product interface to make it accessible to more users. These are considered best practices and usually do not require a lot of time and effort.

The viewport on mobile

Do not prevent users from zooming a page in and out on a mobile device, this is an accessibility issue.

Color contrast

-- Create a new task based on the currently selected message in Airmail
-- When Script is run (I suggest FastScripts https://red-sweater.com/fastscripts/) A new line will be added to the taskpaper file of your choice.
-- Quite a lot modified to input text into a plain text file like used by taskpaper. Originally based somewhere back in time on Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Airmail 2"
log "get selected messages"
set theSelection to selected messages
--loop through all selected messages
@sirtimbly
sirtimbly / airmail-to-textfile.scpt
Created November 1, 2016 02:14
Plain Text Productivity - Airmail email client messages become new tasks in a text file
-- Create a new task based on the currently selected message in Airmail
-- When Script is run (I suggest FastScripts https://red-sweater.com/fastscripts/) A new line will be added to the taskpaper file of your choice.
-- Quite a lot modified to input text into a plain text file like used by taskpaper. Originally based somewhere back in time on Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
set theTaskFile to "/Users/tbendt/Dropbox/_Tim/Projects/_tasks/projects.taskpaper"
tell application "Airmail 2"
--get selected messages
set theSelection to selected messages
--loop through all selected messages
@sirtimbly
sirtimbly / cause of death.md
Last active May 10, 2016 16:44
accidental causes of death

Cause of Death from 1999 - 2014

Injury Intent: Unintentional Injury Mechanism & All Other Leading Causes: Natural/Environmental

Cause Deaths
Total 25946
Exposure to excessive natural cold 10599
@sirtimbly
sirtimbly / handbrake hazel bash script.txt
Created April 27, 2015 03:27
Hazel Handbrake conversion bash script
outdir=${$1%/*}
filename=${s##*/}
filename=${filename%.*}
output_filename="$outdir/$filename.m4v"
HandBrakeCLI -i $1 -o $output_filename --preset="Normal"
@sirtimbly
sirtimbly / patternlab-performance.html
Created April 1, 2015 14:32
pattern-lab performance display menu
<li class="sg-perf">
<a href="#" class="sg-acc-handle sg-perf-toggle" id="sg-perf-toggle" title="perf">00</a>
<ul class="sg-acc-panel sg-right">
<li class="stat responseStart" title="ms until server response started">responseStart: <span id="sg-response-start"></span></li>
<li class="stat responseEnd" title="ms until server response finished">responseEnd: <span id="sg-response-end"></span></li>
<li class="stat domInteractive" title="ms until dom was interactive to user">domInteractive: <span id="sg-dom-interactive"></span></li>
<li class="stat domInteractive" title="ms until dom was completely loaded">domLoaded: <span id="sg-dom-loaded"></span></li>
</ul>
</li>
@sirtimbly
sirtimbly / gist:988d4c1e26e8c5666ac2
Created April 1, 2015 14:31
pattern-lab performance script
<script type="text/javascript">
$('iframe#sg-viewport').load(function() {
var now = new Date().getTime();
var perfTimes = this.contentWindow.performance.timing;
var page_load_time = now - perfTimes.navigationStart;
var response_start_time = perfTimes.responseStart - perfTimes.navigationStart;
var response_end_time = perfTimes.responseEnd - perfTimes.navigationStart;
var response_dom_int = perfTimes.domInteractive - perfTimes.navigationStart;
console.log("User-perceived page loading time: " + page_load_time);
$('#sg-perf-toggle').html(page_load_time + 'ms');
@sirtimbly
sirtimbly / keybase.md
Created January 12, 2015 22:04
keybase.md

Keybase proof

I hereby claim:

  • I am sirtimbly on github.
  • I am sirtimbly (https://keybase.io/sirtimbly) on keybase.
  • I have a public key whose fingerprint is BB9A 8F08 A763 D832 2CD6 FFB2 6CF3 B94C B486 41B1

To claim this, I am signing this object:

@sirtimbly
sirtimbly / gist:57bb6fce2a861628e007
Created September 8, 2014 19:32
mail to taskpaper text file
-- Quite a lot modified to input text into a plain text file like used by taskpaper. Originally based somewhere back in time on Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Mail"
--get selected messages
set theSelection to selection
--loop through all selected messages
repeat with theMessage in theSelection
--get information from message
set theMessageDate to the date received of theMessage