Skip to content

Instantly share code, notes, and snippets.

@nybblr
nybblr / example.js
Last active April 5, 2018 15:34
In-browser image resizing + processing
import processImage from 'process-image';
var file = /* File() object from drag-n-drop or file input */
var imageProcessOpts = {
maxWidth: 1200,
maxHeight: 1200,
quality: 0.6
};
@manishkkatoch
manishkkatoch / MockCLLocationManager.swift
Created December 6, 2017 17:42
Mocking CLLocationManager
//
// MockCLLocationManager.swift
//
// Created by Manish Katoch on 11/28/17.
// Copyright © 2017 Manish Katoch. All rights reserved.
//
import Foundation
import CoreLocation
import React from 'react';
import { ApolloProvider } from 'react-apollo';
import { Provider } from 'react-redux';
import hoistNonReactStatic from 'hoist-non-react-statics';
export default apolloAndReduxProviderHOC = (WrappedComponent, store, client) => {
class Enhance extends React.Component {
render () {
return (
<Provider store={store}>
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@matteocollina
matteocollina / beta_lane.sh
Last active February 5, 2020 13:57
Beta lane - Fastlane (ad-hoc)
platform :ios do
desc "This is beta lane"
lane :beta do
get_provisioning_profile(
adhoc: true,
force: true
)
increment_build_number
gym(export_method:"ad-hoc",
scheme: "Golee",
@AlexBrasileiro
AlexBrasileiro / index.js
Last active November 17, 2024 01:09
ShareYourFeedback
// inspiration: https://dribbble.com/shots/4370657-Share-Your-Feedback
import React, { Component, Fragment } from "react";
import { Animated, StyleSheet, Text, View, TouchableOpacity, Dimensions, Platform, Easing, TextInput, KeyboardAvoidingView, Image } from "react-native";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const { width: windowWidth } = Dimensions.get('window');
const Icon = (props) => <FontAwesome5 {...props} />
@sixeyed
sixeyed / profile.ps1
Created November 1, 2018 11:25
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
// sequential
function App() {
let one = Resource.read('1')
let two = Resource.read('2')
let three = Resource.read('3')
return (
<div>
<div>{one}</div>
<div>{two}</div>
<div>{three}</div>
@alfonmga
alfonmga / apollo-refreshToken-link.js
Last active September 5, 2023 22:29
Apollo refresh auth token link. It tries to refresh the user access token on the fly when API throws out an UNAUTHENTICATED error. If multiple requests fail at the same time, it queues them to re-try them later if we are able to get a new access token, otherwise we log out the user and redirect him to the login page.
@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({