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 { connect, UR } from "getstream"; | |
import React, { ReactNode } from "react"; | |
import { | |
DefaultAT, | |
DefaultUT, | |
FeedManager, | |
FeedProps, | |
SharedFeedManagers, | |
StreamAppProvider | |
} from "react-activity-feed"; |
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
// Example: Given an array of distinct integer values, count the number of | |
// pairs of integers that have difference k. For example, given the array | |
// { 1, 7, 5, 9, 2, 12, 3} and the difference k = 2,there are four pairs with | |
// difference 2: (1, 3), (3, 5), (5, 7), (7, 9). | |
// | |
// A brute force algorithm is to go through the array, starting from the first | |
// element, and then search through the remaining elements (which will form the | |
// other side of the pair). For each pair, compute the difference. If the | |
// difference equals k, increment a counter of the difference. | |
// |
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
var N46CO = document.querySelector(".checkout-button") | |
if (N46CO && fbq) { | |
N46CO.addEventListener("click", function () { | |
var node = document.querySelector(".order-total td") | |
if (!node) return | |
var text = node.innerText.replace("$", "") | |
var value = Number.parseFloat(text).toFixed(2) | |
fbq("track", "Initiated: Checkout", { currency: "AUD", value: value }) | |
}) | |
} |
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
function fish_prompt | |
echo (id -u)": " | |
end | |
function mpw | |
docker run \ | |
--rm \ | |
-ti elliotmitchum/mpw mpw -t x -u "Elliot Mitchum" $argv | |
end |
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
#!/usr/bin/env bash | |
set -e | |
set -u | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y dist-upgrade | |
sudo apt-get -y autoremove |
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 from "react" | |
import { Query, compose, graphql } from "react-apollo" | |
import gql from "graphql-tag" | |
/** | |
* Config. | |
*/ | |
const config = { | |
menu: [ |
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 from "react" | |
import { Query, compose, graphql } from "react-apollo" | |
import gql from "graphql-tag" | |
/** | |
* Config. | |
*/ | |
const config = { | |
menu: [ |
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 from "react" | |
const Foo = () => { | |
const header = <p key="foo-header">Foo Header</p> | |
const main = <p key="foo-main">Foo Main</p> | |
const footer = <p key="foo-footer">Foo Footer</p> | |
return { | |
header: [header], | |
main: [main], | |
footer: [footer] |
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
const time = () => Math.round(Date.now() / 1000) | |
class Component { | |
constructor () { | |
this.event = new Event('update') | |
this.state = { m: time().toString() } | |
this.element = document.createElement('div') | |
this.element.addEventListener('update', e => { | |
this.element.innerHTML = this.render() | |
}) |
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
<h2>Maecenas nec ultrices nibh</h2> | |
<p>Vestibulum sed tortor non sem consectetur scelerisque at quis dolor. Etiam convallis | |
iaculis molestie. Cras cursus aliquam velit quis congue.</p> | |
<p>Aliquam semper libero ac lacus bibendum semper. Sed eu magna a ligula consectetur | |
auctor. Vivamus ullamcorper, elit feugiat venenatis venenatis, arcu ligula mollis diam, | |
a malesuada elit dui sed dui.</p> | |
<h2>Aenean purus enim, fringilla et ultricies</h2> | |
<p>Fusce convallis, velit vitae semper viverra, nibh ex sagittis tortor, eget | |
vestibulum nibh enim eu elit. Donec et ante elementum, mollis sapien eu, scelerisque | |
lacus. Vestibulum finibus convallis mauris.</p> |
NewerOlder