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 { useSpring, animated } from 'react-spring'; | |
import { useDrag } from 'react-use-gesture'; | |
import PropTypes from 'prop-types'; | |
const THRESHOLD_PX = 100; | |
function AnimatedSwipeNavigation({ onSwipeLeft, onSwipeRight, vertical = false, horizontal = true, children }) { | |
const [{ x, y }, set] = useSpring(() => ({ x: 0, y: 0 })); |
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
-- COHORT ANALYSIS | |
-- (merchant_location_id, cohort_month), each | |
with cohort_items as ( | |
select | |
date_trunc('month', ML.created_at)::date as cohort_month, | |
id as merchant_location_id | |
from merchant_locations ML | |
), | |
-- (merchant_location_id, month_number): merchant X has activity in month number X | |
merchant_appointments as ( |
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
defmodule WebsocketApi.MerchantLocationChannel do | |
use WebsocketApi.Web, :channel | |
alias WebsocketApi.{ | |
DeviceWatcher, | |
MerchantLocation, | |
MerchantLocationDevice, | |
Repo | |
} | |
require Logger | |
@moduledoc false |
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
document.addEventListener('scroll', this.onScroll); | |
function onScroll() { | |
const offSet = this.getOffset(); | |
const midScreen = window.innerHeight / 2; | |
let opacity = 1; | |
// element is in viewport | |
if (Math.abs(offSet) < midScreen) { | |
// *pow to amplify opacity |
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
#!/bin/sh | |
BOXNAME=`date +'vm_box_%m%d%Y_%H%M%S'` | |
vagrant destroy --force || exit $? | |
PACKAGING_BASE_BOX=1 vagrant up || exit $? | |
PACKAGING_BASE_BOX=1 vagrant package --out "$BOXNAME.box" || exit $? | |
vagrant box add $BOXNAME "./$BOXNAME.box" || exit $? | |
aws s3 cp "$BOXNAME.box" "s3://vagrant-boxes/" || exit $? |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# name of virtualbox | |
config.vm.provider :virtualbox do |vb| |
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 moment from "moment/moment"; | |
+ | |
+// | |
+ | |
+class CachedResource { | |
+ constructor( | |
+ cachedResourceKey, | |
+ cachedTimestampKey, | |
+ source, | |
+ dirtyFunc, |
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
handleDrop = files => { | |
// Push all the axios request promise into a single array | |
const uploaders = files.map(file => { | |
// Initial FormData | |
const formData = new FormData(); | |
formData.append("file", file); | |
formData.append("tags", `codeinfuse, medium, gist`); | |
formData.append("upload_preset", "pvhilzh7"); // Replace the preset name with your own | |
formData.append("api_key", "1234567"); // Replace API key with your own Cloudinary key | |
formData.append("timestamp", (Date.now() / 1000) | 0); |
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
#!/bin/bash | |
if [[ "$1" != "" ]]; then | |
S3BUCKETNAME="$1" | |
else | |
echo ERROR: Failed to supply S3 bucket name | |
exit 1 | |
fi | |
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public |
NewerOlder