Skip to content

Instantly share code, notes, and snippets.

View julioxavierr's full-sized avatar
🦄
raising unicorns

Julio Xavier julioxavierr

🦄
raising unicorns
View GitHub Profile
@evertbouw
evertbouw / epicMarbleTest.ts
Last active May 17, 2019 13:59
Writing tests for epics with state$ and using marble diagrams. More information on marble testing can be found at https://github.com/ReactiveX/rxjs/blob/master/doc/marble-testing.md
import { Action } from "redux";
import { ActionsObservable, Epic, StateObservable } from "redux-observable";
import { TestScheduler } from "rxjs/testing";
const assertDeepEquals = (actual: any, expected: any) => {
expect(actual).toEqual(expected);
};
export const marbleTest = <T extends Action, O extends T = T, S = void, D = any>({
epic,

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@lucianomlima
lucianomlima / adb_connect.sh
Created June 5, 2019 17:57
Connect to Android devices with ADB through wi-fi
function adb_connect {
# PORT used to connect. Default: 5555
PORT=${1:-5555}
# IP address from current device connected
IP_ADDRESS=`adb shell ip route | awk '{print $9}'`
echo "ADB connect to $IP_ADDRESS on port $PORT"
# Change connection from usb to tcpip using $PORT
@julioxavierr
julioxavierr / react-native-update.md
Last active July 23, 2019 01:46
Steps to update a React Native app

React Native Upgrade path

  • Change React and React Native version on package.json
  • run yarn install to upgrade dependencies
  • run yarn outdated or yarn upgrade-interactive libraries that are outdated (make sure that there's no breaking changes, check release notes (one by one))
  • check the diff or use the upgrade-helper and update the native code
  • open Xcode and link the binaries
  • run on iOS
  • test iOS
  • run on Android
  • test Android
@tcodes0
tcodes0 / links-and-cool-hacks.txt
Last active February 7, 2024 16:07
LINKS AND COOL HACKS
@sibelius
sibelius / relay.config.js
Created November 17, 2019 00:58
Relay Config that works well with monorepo, you can spread your fragments in many packages
module.exports = {
schema: './data/schema.graphql',
language: 'typescript',
src: '../.',
include: [
'./web/src/**',
'./shared/src/**',
],
};
@mmazzarolo
mmazzarolo / scale.ts
Last active December 23, 2019 14:51
React-Native metrics scaling
import { PixelRatio, Dimensions } from "react-native";
const isTabletLike = () => {
const pixelDensity = PixelRatio.get();
const adjustedWidth = Dimensions.get("screen").width * pixelDensity;
const adjustedHeight = Dimensions.get("screen").height * pixelDensity;
return (
(pixelDensity < 2 && (adjustedWidth >= 1000 || adjustedHeight >= 1000)) ||
(pixelDensity === 2 && (adjustedWidth >= 1920 || adjustedHeight >= 1920))
);
@jgcmarins
jgcmarins / mapboxToAddress.ts
Created January 30, 2020 21:46
Mapbox helpers
import idx from 'idx';
import { ForwardFeature } from './mapboxTypes';
export interface AddressResult {
id?: string | null;
fullAddress?: string | null;
shortAddress?: string | null;
zipcode?: string | null;
street?: string | null;
@xvaara
xvaara / postgraphiql.ts
Last active October 28, 2021 06:06
Dark mode for PostgraphiQL
const graphiqlBrandingTweak = {
["postgraphile:graphiql:html"](html: string) {
console.log("Applying GraphiQL Branding Tweak...");
return html.replace(
"</head>",
`<style type="text/css">
@media (prefers-color-scheme: dark) {
html {
filter: invert(1) hue-rotate(180deg);
}