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) {
@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>
);
@andymatuschak
andymatuschak / MultiDirectionAdjudicatingScrollView.swift
Created January 26, 2015 19:31
Source for the Khan Academy app's unusual scrolling interactions
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass
@iainconnor
iainconnor / setup.sh
Last active September 8, 2019 16:00
OSX Setup
me=$(whoami)
# Get Sudo.
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Install Xcode command line tools.
xcode-select --install
@pranavrajs
pranavrajs / escapeChar.js
Created December 19, 2016 14:09
React-Native Escape Character
function escapeCharAndroid(url, body) {
return fetch(url, { // Use your url here
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(body)
})
.then(response => response.text()) // Convert to text instead of res.json()
@beausmith
beausmith / SVG.js
Created May 23, 2017 18:09
React Native SVG Component using react-native-svg
// React Native SVG Component
// https://github.com/react-native-community/react-native-svg
//
// Process
// 1. Clean up SVG in graphics app (Illustrator/Sketch/etc) to set consistent width, height, and make sure the viewBox is "0, 0, W, H"
// 2. Open SVG in text editor to remove width, height, and any undesired/unnecessary styles
// 3. Open in https://jakearchibald.github.io/svgomg/ and optimize.
// 4. Integrate info app by converting SVG tags to component-based SVG tags used in https://github.com/react-native-community/react-native-svg and updating with JS variables such that I can controls dimensions, colors, etc.
// 5. Use in other components.
//
//
// PaginationNetworkLogic.swift
//
// Created by Daniel Tartaglia on 4/9/17.
// Copyright © 2019 Daniel Tartaglia. MIT License
//
import RxSwift
struct PaginationUISource {
@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
@Tokuriku
Tokuriku / Count lines of code in Xcode project
Last active March 9, 2023 23:16 — forked from ccabanero/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)