Skip to content

Instantly share code, notes, and snippets.

View ortonomy's full-sized avatar

Gregory Orton ortonomy

View GitHub Profile
@ortonomy
ortonomy / altair_aws_cognito_confidential_client.js
Created February 6, 2023 02:17
Altair GraphQL client pre-request script for AWS Cognito confidential client login
const CryptoJS = await altair.importModule('crypto-js');
const b64Decode = await altair.importModule('atob');
const collectEnvironmentVariables = () => {
const clientId = altair.helpers.getEnvironment('AwsCognitoClientId')
const clientSecret = altair.helpers.getEnvironment('AwsCognitoClientSecret')
const region = altair.helpers.getEnvironment('AwsCognitoRegion')
const username = altair.helpers.getEnvironment('AwsCognitoUsername')
const password = altair.helpers.getEnvironment('AwsCognitoPassword')
@ortonomy
ortonomy / .zshrc
Created April 29, 2022 04:50
.zshrc - spaceship prompt
# If you come from bash you might have to change your $PATH.
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"
export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
@ortonomy
ortonomy / stripe.php
Created April 15, 2021 01:08
stripe.php
<?php
$account = $this->client->accounts->create(
[
'type' => 'express',
'email' => $user->email,
'business_profile' => [
'mcc' => '7392',
'url' => 'happyconsults.com'
],
import React from 'react'
import { withRouter } from 'next/router'
export const AuthContext = React.createContext({
isAuthenticated: false,
token: null,
user: null,
})
/**
import React from 'react'
import styled from 'styled-components'
import { version } from '../../../../package.json'
import { FlexContainerPositionable } from '../../../components/common/Layout'
import { SmallLightBoldText } from '../../../components/common/Text'
import * as Mixins from '../../../styles/Mixins'
const VersionContainer = styled(FlexContainerPositionable)`
${Mixins.Shadow}
${Mixins.BackgroundColor}
@ortonomy
ortonomy / city.svg
Last active September 8, 2019 05:14
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ortonomy
ortonomy / hyper.js
Last active September 6, 2019 07:12
hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@ortonomy
ortonomy / axios.js
Created August 12, 2018 14:40
using axios
export const axios = Axios.create({
baseURL: `${window.location.protocol}//${Connection().PREPSMITH_HOST}`,
withCredentials: true
})
// axios errors
export const ERRORS = {
AUTH_ERROR: new Error('User not logged in'),
NETWORK_ERROR: new Error('Network error'),
SERVER_ERROR: new Error('Server error'),
@ortonomy
ortonomy / propspassing.js
Last active April 12, 2018 09:22
How to pass methods as props to children and grand-children in react
// demo https://codesandbox.io/s/pymqjk7nkj
import React, { Component } from 'react';
class One extends Component {
constructor(props) {
super(props);
this.methodOne = this.methodOne.bind(this);
this.state = {
clicked: false
@ortonomy
ortonomy / gist:687e9985113aa6aabd8fd87840f6bcf4
Created February 6, 2018 03:01 — forked from chuckwagoncomputing/gist:4234127
pbcopy ssh public key to your clipboard
#pbcopy < ~/.ssh/id_rsa.pub
#or
cat ~/.ssh/id_rsa.pub | pbcopy