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 {GetServerSideProps, InferGetServerSidePropsType, NextPage} from 'next'; | |
import styles from '../styles/Home.module.css'; | |
import Footer from '../components/Footer'; | |
import Header from '../components/Header'; | |
import Meta from '../components/Meta'; | |
import {useEffect, useState} from 'react'; | |
import Link from 'next/link'; | |
import {supabaseClient, withPageAuth} from '@supabase/auth-helpers-nextjs'; | |
export const getServerSideProps: GetServerSideProps = withPageAuth({redirectTo: '/auth'}); |
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 {GetServerSideProps, InferGetServerSidePropsType, NextPage} from 'next'; | |
import styles from '../styles/Home.module.css'; | |
import Footer from '../components/Footer'; | |
import Header from '../components/Header'; | |
import Meta from '../components/Meta'; | |
import {useEffect, useState} from 'react'; | |
import Link from 'next/link'; | |
import {supabaseClient, withPageAuth} from '@supabase/auth-helpers-nextjs'; | |
export const getServerSideProps: GetServerSideProps = withPageAuth({redirectTo: '/auth'}); |
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 {NextPage} from 'next'; | |
import {supabaseClient} from '@supabase/auth-helpers-nextjs'; | |
import {useUser} from '@supabase/auth-helpers-react'; | |
import {useEffect, useState} from 'react'; | |
import {Auth} from '@supabase/ui'; | |
import styles from '../styles/Home.module.css'; | |
import Meta from '../components/Meta'; | |
import Header from '../components/Header'; | |
import Footer from '../components/Footer'; | |
import {useRouter} from 'next/router'; |
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 {NextPage} from 'next'; | |
import styles from '../styles/Home.module.css'; | |
import Meta from '../components/Meta'; | |
import Header from '../components/Header'; | |
import Footer from '../components/Footer'; | |
import {withPageAuth} from '@supabase/auth-helpers-nextjs'; | |
export const getServerSideProps = withPageAuth({redirectTo: '/login'}); | |
const Profile: NextPage = ({user}) => { |
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 {Auth} from '@supabase/ui'; | |
import styles from '../styles/Home.module.css'; | |
import Meta from '../components/Meta'; | |
import Header from '../components/Header'; | |
import {supabase} from '../lib/initSupabase'; | |
// export async function getStaticProps() {} | |
const LoginPage = () => { | |
const {user} = Auth.useUser(); |
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
<title><?php | |
if (is_home () ) { echo sprintf('The %s Blog', get_bloginfo(‘name’)); } | |
elseif ( is_category() ) { single_cat_title(); echo ‘ - ‘ ; bloginfo(‘name’); } | |
elseif (is_single() ) { echo sprintf('%s – The %s Blog', single_post_title(false), get_bloginfo(‘name’));} | |
elseif (is_page() ) { single_post_title();} | |
else { wp_title('',true); echo sprintf(' Blog – %s', get_bloginfo(‘name’));} | |
?></title> |
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 machine = Machine({ | |
id: 'machine', | |
type: 'parallel', | |
states: { | |
order: { | |
initial: 'DoesNotExist', | |
states: { | |
DoesNotExist: { | |
on: { | |
MB_send_order: 'UNSENT', |
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 fetchMachine = Machine({ | |
id:'newOrder', | |
initial: 'DoesNotExist', | |
states: { | |
DoesNotExist: { | |
on: { | |
MB_create_order: 'UNSENT', | |
} | |
}, | |
UNSENT: { |
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
# autoload venv if there's a .venv file | |
# Support for bash | |
PROMPT_COMMAND='prompt' | |
# Mirrored support for zsh. See: https://superuser.com/questions/735660/whats-the-zsh-equivalent-of-bashs-prompt-command/735969#735969 | |
precmd() { eval "$PROMPT_COMMAND" } | |
function prompt() | |
{ | |
if [ "$PWD" != "$MYOLDPWD" ]; then |
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
// requires Underscore.js | |
// uses jQuery style funciton declaration (if you aren't using jQuery, simply re-arrange the declaration) | |
function sum(arr) { | |
// returns the sum total of all values in the array | |
return _.reduce(arr, function(memo, num) { return memo + num}, 0); | |
} | |
function average(arr) { | |
// returns the average of all values in the array |
NewerOlder