Skip to content

Instantly share code, notes, and snippets.

View joshbedo's full-sized avatar
🤙

Josh Bedo joshbedo

🤙
View GitHub Profile
@joshbedo
joshbedo / webhook.ts
Created August 11, 2023 14:29
webhook.ts
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { NextApiRequest, NextApiResponse } from 'next';
import type Stripe from 'stripe';
import { prisma } from '~/server/db';
import { stripe } from '~/utils/stripe';
import { buffer } from 'micro';
@joshbedo
joshbedo / css-media-queries-cheat-sheet.css
Created December 7, 2021 18:46 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@joshbedo
joshbedo / metafields.js
Created November 24, 2021 15:27
Shopify Metafields - Make new metafields visible for storefront API
// This needs entered in Shopify's GraphQL app to change visibility of metafield.
mutation ($input: MetafieldStorefrontVisibilityInput!) {
metafieldStorefrontVisibilityCreate(input: $input) {
metafieldStorefrontVisibility {
id
}
userErrors {
field
message
@joshbedo
joshbedo / git.migrate
Created August 19, 2020 17:32 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@joshbedo
joshbedo / react.redux.js
Created June 1, 2017 22:08
React/Redux
/**
* Actions
**/
import {
VEHICLE_MAKE_CHANGED,
VEHICLE_MODEL_CHANGED,
VEHICLE_ADD_REQUEST,
VEHICLE_ADD_SUCCESS,
VEHICLE_ADD_ERROR
} from './types';
@joshbedo
joshbedo / Routes.js
Created June 1, 2017 22:01
Checkout Routes
import Joi from 'joi';
import routePrerequisites from './routePrerequisites';
// Data schemas
import {CheckoutSerializer} from './serializers';
// API endpoint handlers
import {
CheckoutsHandler,
CheckoutIdHandler
} from './handlers';
@joshbedo
joshbedo / model.js
Created June 1, 2017 21:59
Checkout Model
import {Decorators as DBDecorators} from '../../core/db';
import {PermissionDenied} from '../../core/errors';
import {Cart} from '../carts/models';
import {CartSerializer} from '../carts/serializers';
import {User} from '../users/models';
import log from './logging';
const tables = {
Checkout: 'Checkouts'
@joshbedo
joshbedo / handlers.js
Created June 1, 2017 21:57
Checkout Route Handlers
import Joi from 'joi';
import {sanitizeEmailAddress} from '../../core/email';
import {ErrorName} from '../../core/errors';
import {BadRequest} from '../../core/responses';
import {hasKeys} from '../../core/utils';
import {Cart} from '../carts/models';
import log from './logging';
import {Checkout} from './models';
@joshbedo
joshbedo / renderSceneFix
Created January 8, 2016 00:04
fix renderScene
renderScene(route, navigator) {
if (route && route.component) {
let Component = route.component;
return (
<Component navigator={navigator} route={route} />
)
}
switch (this.state.currentRoute) {
case 'LOGIN_STATE_LOGOUT':
@joshbedo
joshbedo / proxy.js
Created December 19, 2015 08:22
Docker proxy
//var GUEST_URL = process.env['DOCKER_HOST'].substring(0, guestPortIndex);
console.log(proxy.createServer({
target : 'http://192.168.99.100',
ws: true
}).listen(2376));