Skip to content

Instantly share code, notes, and snippets.

View bobwhitelock's full-sized avatar
:shipit:

Bob Whitelock bobwhitelock

:shipit:
View GitHub Profile
@simonw
simonw / crontab.txt
Created September 10, 2020 16:09
Dogsheep crontab.txt as of 10th September 2020
# Fetch latest configuration:
*/5 * * * * cd /home/ubuntu/dogsheep-config && python3 git_pull_and_run_scripts.py . && sudo python3 ensure_symlinks.py files-to-symlink
# Goodreads
46 * * * * cd /home/ubuntu && /home/ubuntu/datasette-venv/bin/goodreads-to-sqlite books goodreads.db -a auth.json
# Twitter
1,11,21,31,41,51 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite user-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since
2,7,12,17,22,27,32,37,42,47,52,57 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite home-timeline /home/ubuntu/timeline.db -a /home/ubuntu/auth.json --since
4,14,24,34,44,54 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite mentions-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since
@evancz
evancz / data-interchange.md
Last active April 29, 2024 16:53
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@spikeheap
spikeheap / sessions.md
Last active August 20, 2017 15:09
Introduction to Coaching Workshop, Oxford 2017-08-12

Workshop sessions

First we split into groups of 5 and asked:

What experience do you have of coaching or mentoring? What’s the difference between mentoring and coaching?

Session 1

Once we’d committed to confidentiality and making the workshop a safe space, in pairs we covered:

What is it like doing your job?

-- Read more about this program in the official Elm guide:
-- https://guide.elm-lang.org/architecture/effects/time.html
module App exposing (..)
import Html exposing (Html)
import Svg exposing (..)
import Svg.Attributes exposing (..)
import Time exposing (Time, second)
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
import Html exposing (..)
import Html.Events exposing (..)
main : Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = \_ -> Sub.none
@wyze
wyze / app.js
Created November 10, 2015 04:32
Redux state passed to onEnter of react-router.
import createHistory from 'history/lib/createBrowserHistory';
import createStore from './redux/createStore';
import createRoutes from './routes';
import React from 'react';
import { Provider } from 'react-redux';
import { Router } from 'react-router';
import { render } from 'react-dom';
const history = createHistory();
const store = createStore(history, window.__data);
@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@robschmuecker
robschmuecker / README.md
Last active May 13, 2024 20:57
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.