This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Memoized<A: Equatable, R> { | |
typealias Value = (_ params: A) -> R | |
var callback: Value | |
@XState private var prevParam: A? = nil | |
@XState private var prevValue: R? = nil | |
init(_ callback: @escaping Value) { | |
self.callback = callback | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from "react"; | |
class NowPlayingView extends React.Component { | |
componentDidMount() { | |
this.props.logViewNowPlayingScreen(); | |
} | |
componentDidUpdate = prevProps => { | |
if (prevProps.songId !== this.props.songId) { | |
this.props.logChangeSong(songId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from "react"; | |
import { Amplitude, LogOnMount } from "@amplitude/react-amplitude"; | |
const NowPlayingView = props => { | |
return ( | |
<Amplitude | |
// All events logged in this subtree will include these event properties | |
eventProperties={inheritedProps => ({ | |
...inheritedProps, | |
"song id": props.songId, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER_IMAGE ?= ryanashcraft/ghost:1.0 | |
DOCKER_CONTAINER ?= ghost | |
dev: | |
docker build -f Dockerfile.dev -t $(DOCKER_IMAGE) . | |
docker rm $(DOCKER_CONTAINER) && docker run \ | |
-p 2368:2368 \ | |
-v ${PWD}/content/data:/var/www/ghost/content/data \ | |
-v ${PWD}/content/images:/var/www/ghost/content/images \ | |
--name $(DOCKER_CONTAINER) \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://news.ycombinator.com/ | |
## API | |
### Top Stories | |
https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty | |
### Story |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* deep-diff. | |
* Licensed under the MIT License. | |
*/ | |
;(function(root, factory) { | |
'use strict'; | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define([], factory); | |
} else if (typeof exports === 'object') { |
NewerOlder