Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am david-crespo on github.
  • I am davidcrespo (https://keybase.io/davidcrespo) on keybase.
  • I have a public key whose fingerprint is F822 6F3D 1723 E9D5 782D 50EF 74DD 327E 01E2 1D5D

To claim this, I am signing this object:

@david-crespo
david-crespo / fetchPolls.js
Last active March 20, 2019 21:43
Fetch latest polls from 538 and ping IFTTT if there are any
#! /app/.heroku/node/bin/node
"use strict";
const moment = require('moment-timezone');
const request = require('request');
const _ = require('lodash');
const updatesURL = 'http://projects.fivethirtyeight.com/2016-election-forecast/updates.json';
const forecastURL = 'http://projects.fivethirtyeight.com/2016-election-forecast/US.json';
const notificationURL = 'https://maker.ifttt.com/trigger/new_polls/with/key/<YOUR_KEY_HERE>';
@david-crespo
david-crespo / toggle_scroll.scpt
Created October 25, 2016 17:50
Toggle natural scrolling on MacOS
try
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.trackpad"
end tell
tell application "System Events"
tell process "System Preferences"
click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
click checkbox 1 of tab group 1 of window "Trackpad"
@david-crespo
david-crespo / react-in-2-minutes.md
Last active January 18, 2021 07:14
React in 2 Minutes

React in 2 minutes

a React component takes

  • props, which are like HTML attributes, arguments passed in from outside

it has

  • state, an internal object to track state, e.g., the contents of a text field or the value of a checkbox
  • setState, call this to update the state object and trigger a re-render (never modify state directly)
@david-crespo
david-crespo / README.md
Last active February 15, 2023 21:30
Download FB tagged photos and videos

Download photos and videos you're tagged in on Facebook

Why

When you download an archive of your Facebook account, Facebook includes photos and videos you've uploaded, but not photos and videos you're tagged in that were uploaded by other people. This is a script to automatically download those.

Setup

This requires Python 3.

@david-crespo
david-crespo / rain-world.md
Last active May 10, 2024 18:40
How to Enjoy Rain World

How to Enjoy Rain World

A spoiler-free guide to the spoilers

TL;DR: play as long as you can without help, until you get frustrated. At that point, the recommended region order helps a lot without spoiling anything but region names. If you can't find the next region, the world map (only showing region connections, no detail) will tell you what direction to look in.

Rain World is a masterpiece — equal parts metroidvania, movement puzzler, immersive rat in Manhattan sim — but its strangeness makes it hard to appreciate. Some things that turned players and reviewers off were fixed in [patches](https:/

@david-crespo
david-crespo / LICENSE
Last active July 31, 2020 01:41
Markdown to JIRA script
Copyright 2013 Fokke Zandbergen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@david-crespo
david-crespo / README.md
Last active January 21, 2021 23:04
Deckset to web page converter

Deckset to web page converter

This is a handy script to convert a Deckset presentation into a clean web page with the slides on the left and speaker notes on the right. It uses PNGs generated by the Deckset app for the slides and extracts the speaker notes from the presentation markdown.

Setup

Python 3 is required.

pip install markdown jinja2
@david-crespo
david-crespo / ts-release-highlights.md
Last active May 14, 2023 21:03
TypeScript release highlights thru 5.0

TypeScript release highlights

These aren't meant to be comprehensive. They're just the features that most interest me. CFA = control-flow analysis.

1.4: union types and better inference on generics using the union type

1.6: JSX, intersection types, generic type aliases

1.8: type params referring to other type params, string literal types

@david-crespo
david-crespo / readme.txt
Created April 12, 2023 17:03
Light Lines (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html