This file contains 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') { |
This file contains 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 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 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 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 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 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 Foundation | |
public class RemoteInspector { | |
private struct UpdateMessage<T: Encodable>: Encodable { | |
let type = "update" | |
var id: String | |
var data: T | |
} | |
private struct LogMessage: Encodable { |
This file contains 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 SwiftUI | |
struct WidthPreferenceKey: PreferenceKey { | |
typealias Value = CGFloat? | |
static var defaultValue: CGFloat? | |
static func reduce(value: inout CGFloat?, nextValue: () -> CGFloat?) { | |
if let nextValue = nextValue(), value != nextValue { | |
value = nextValue |
This file contains 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 SwiftUI | |
// Models | |
enum Lyric { | |
case line(String) | |
case pause(TimeInterval) | |
} | |
class ScrollToModel: ObservableObject { |
OlderNewer