Skip to content

Instantly share code, notes, and snippets.

View jstheoriginal's full-sized avatar
👨‍💻

Justin Stanley jstheoriginal

👨‍💻
View GitHub Profile
import { Client, Configuration } from 'bugsnag-react-native';
module.exports = { // cached singleton instance
instance: null,
create(key, store, codeBundleId) {
if (this.instance === null) {
if (key == null) {
@alfonsomunozpomer
alfonsomunozpomer / Fetch.test.js
Created September 28, 2017 12:51
How to test a React component that sets its state in componentDidMount with fetch, and how to mock it, in Jest
// https://github.com/alfonsomunozpomer/react-fetch-mock
import React from 'react'
import fetchMock from 'fetch-mock'
import Enzyme from 'enzyme'
import {shallow, mount, render} from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
Enzyme.configure({ adapter: new Adapter() })
@slorber
slorber / Lazy.js
Created April 23, 2018 15:30
Lazy react native comp
import React from 'react';
import {InteractionManager, ActivityIndicator} from 'react-native';
import {View} from 'glamorous-native';
const DefaultLoader = (
<View padding={20} alignItems="center" justifyContent="center">
<ActivityIndicator size="large"/>
</View>
);
@epynic
epynic / debugging.sh
Last active September 16, 2022 16:43
Bash Scripting Zero to Hero Examples
#debugging shellscripts -x would show the scrips line by line and output followed by
#!/bin/bash -x
TEST_VAR="test"
echo "$TEST_VAR"
#custom
#set -x / start debugginh
#set +x / stop
#-ex exit on stop
#-v prints shell before substitution are applied
#-vx