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, { useState } from 'react' | |
import get from 'ts-get' | |
import { useTheme } from 'emotion-theming' | |
import styled from '~/theme/types' | |
import Navbar from '~/components/organisms/Header' | |
import Footer from '~/components/organisms/Footer' | |
interface BlogPageProps { | |
location: { |
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 { fromRight, fromBottom } from '../lib/transitions'; | |
const screenVerification = ({ prevScene, nextScene }, prevScreen, nextScreen) => { | |
if ( | |
prevScene && | |
prevScene.route.routeName === prevScreen && | |
nextScene.route.routeName === nextScreen | |
) { | |
return true; | |
} |
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
/* | |
* At this point the method receive and object | |
* which has duration as well as percentageRange | |
* that will be in charge of pushing the outgoing | |
* screen | |
*/ | |
export function fromRight({ duration = 300, percentageRange = 0 }) { | |
return { | |
transitionSpec: { |
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
export function fromRight(duration = 300) { | |
return { | |
transitionSpec: { | |
duration, | |
easing: Easing.out(Easing.poly(4)), | |
timing: Animated.timing, | |
useNativeDriver: true, | |
}, | |
screenInterpolator: ({ layout, position, scene }) => { | |
const { index } = scene; |
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 initialValue = new Animated.Value(0) | |
Animated.timing( | |
// Animate value over time | |
initialValue, // The value to drive | |
{ | |
toValue: 1, // Animate to final value of 1 | |
}, | |
).start(); // Start the animation |
Straight to Maintenance
Initialize the droplet with dokku app pre-setup
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
How to convert existing phoenix app to an umbrella app. | |
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134 | |
chrismccord [10:14 PM] | |
@alanpeabody yes, it's straightforward | |
[10:14] | |
1) mix new my_umbrella --umbrella |
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
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
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
class ProductsController < ApplicationController | |
before_filter do | |
if params[:category_id] | |
@product_category = Shoppe::ProductCategory.where(:permalink => params[:category_id]).first! | |
end | |
if @product_category && params[:product_id] | |
@product = @product_category.products.where(:permalink => params[:product_id]).active.first! | |
end | |
end |