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
# Based on https://www.atlassian.com/git/tutorials/dotfiles | |
git clone --bare https://bitbucket.org/durdn/cfg.git $HOME/.cfg | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
mkdir -p .config-backup | |
config checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; |
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
// Drop this into your hook | |
// Do not wrap in a useEffect | |
function whoIsMyDaddy() { | |
try { | |
throw new Error() | |
} catch (e) { | |
// matches this function, the caller and the parent | |
const allMatches = e.stack.match(/(\w+)@|at (\w+) \(/g) | |
// match parent function name | |
const parentMatches = allMatches[2].match(/(\w+)@|at (\w+) \(/) |
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
INIT <str> [email protected] deploy-env | |
stacks.get_default_stack_name:CALL <str> | |
utils.read_environ:CALL <str> | |
utils.read_environ:ARG <str> GITHUB_USERNAME | |
utils.read_environ:RETURNS <str> rahsheen | |
stacks:DATA:login <str> rahsheen | |
stacks:DATA:name <str> dev-rahsheen | |
stacks:DATA:name <str> dev-rahsheen | |
stacks:DATA:name <str> dev-rahsheen | |
stacks:DATA:name <str> dev-rahsheen |
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 { passportAuth } from "blitz" | |
import db from "db" | |
import { Strategy as ShopifyStrategy } from "passport-shopify" | |
import { OAuth2Strategy as GoogleStrategy } from "passport-google-oauth" | |
export default passportAuth(({ ctx, req, res }) => ({ | |
successRedirectUrl: "/", | |
errorRedirectUrl: "/", | |
strategies: [ | |
{ |
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 {createAsyncThunk, createSlice, PayloadAction} from '@reduxjs/toolkit'; | |
import {RootState} from '../../app/store'; | |
interface CounterState { | |
value: number; | |
status: 'idle' | 'loading' | 'failed'; | |
} | |
const initialState: CounterState = { | |
value: 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
"scripts": { | |
"android": "react-native run-android", | |
"ios": "react-native run-ios", | |
"start": "react-native start --host 127.0.0.1", | |
"test": "jest", | |
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", | |
"stop-winadb": "/mnt/c/Users/YOURNAME/AppData/Local/Android/Sdk/platform-tools/adb.exe kill-server", | |
"start-winadb": "/mnt/c/Users/YOURNAME/AppData/Local/Android/Sdk/platform-tools/adb.exe -a nodaemon server start", | |
"winadb": "yarn stop-winadb && yarn start-winadb", | |
"socat": "socat -d -d TCP-LISTEN:5037,reuseaddr,fork TCP:$(ip route|grep default|cut -d ' ' -f3):5037", |
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 browserSync = require('browser-sync'); | |
const {getStoreValue, getThemeIdValue} = require('@shopify/slate-env'); | |
const {getSSLKeyPath, getSSLCertPath} = require('../utilities'); | |
class DevServer { | |
constructor(options) { | |
this.bs = browserSync.create(); | |
this.target = `https://${getStoreValue()}`; | |
this.themeId = getThemeIdValue(); | |
this.port = options.port; |
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, { createContext, useEffect, useState } from "react"; | |
import { ActivityIndicator, Text } from "react-native-paper"; | |
import { View } from "react-native"; | |
import * as Location from "expo-location"; | |
interface LocationContextType { | |
location?: Location.LocationData; | |
refresh: () => void; | |
error: string; | |
loading: boolean; |
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 Controller from '@ember/controller'; | |
import { action, computed } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@tracked searchString; | |
@action | |
updateSearchString(value) { |
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 Controller from '@ember/controller'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@action | |
onSelect(index) { | |
this.selectedIndex = index; | |
} |
NewerOlder