Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

View stvmachine's full-sized avatar
🚀
Doing invaluable work

Esteban Campos stvmachine

🚀
Doing invaluable work
View GitHub Profile
// Special thanks to @stef7 https://github.com/stef7
import { useEffect, useLayoutEffect } from 'react';
const isInBrowser = (): boolean => typeof window !== 'undefined';
/**
* {@link useLayoutEffect} that does not show warning when server-side rendering.
* @see https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
*/
export const useIsomorphicLayoutEffect: typeof useLayoutEffect = isInBrowser()
@stvmachine
stvmachine / styled-animated.md
Created November 29, 2022 04:52 — forked from loganpowell/styled-animated.md
Styled-Components with Animated.js (for React Native, but...)

React Native

styled-components has a ReactNative mode that works exactly the same, except you import the things from styled-components/native:

import styled from 'styled-components/native';

const StyledView = styled.View`
  background-color: papayawhip;
@stvmachine
stvmachine / TouchableScale.tsx
Created November 29, 2022 04:32
Simple scale up touchable
import React, { FunctionComponent } from 'react';
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
import Animated, {
Easing, Extrapolate, interpolate, useAnimatedStyle, useDerivedValue,
useSharedValue, withTiming
} from 'react-native-reanimated';
type Props = {
scaleTo: number;
disabled: boolean;
@stvmachine
stvmachine / github-conventional-comments.js
Created October 28, 2022 05:51 — forked from ifyoumakeit/github-conventional-comments.js
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
question: "question",
thought: "thought",
chore: "chore",
@stvmachine
stvmachine / conventional_commit_messages.md
Created September 26, 2022 02:28 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@stvmachine
stvmachine / nvmlink
Created September 13, 2022 06:40 — forked from MeLlamoPablo/nvmlink
Creates a symlink to /usr/bin/node after using nvm
@stvmachine
stvmachine / rbenv-fish-setup.md
Created September 13, 2022 01:50 — forked from pwenzel/rbenv-fish-setup.md
Installing rbenv in a fish environment

Here we use Homebrew to install rbenv:

  1. brew update; and brew install rbenv ruby-build
  2. Add ~/.rbenv/shims to your PATH
  3. Include the contents of completions/rbenv.fish in your Fish config.
  4. Run rbenv install 2.2.2 and rbenv rehash
  5. Run rbenv global 2.2.2

Now you can run gem install bundler and bundle install within your Ruby project.

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@stvmachine
stvmachine / reboot_simulator.sh
Created December 15, 2021 04:43 — forked from nicnocquee/reboot_simulator.sh
Boot or reboot iOS simulator
#!/bin/bash
BOOTING="Booting "
if [ $# -eq 0 ]
then
SIMULATOR=$(xcrun simctl list | grep Booted | cut -d$'\n' -f1 | cut -d "(" -f2 | cut -d ")" -f1)
if [ ! -z "$SIMULATOR" ]; then
SIMULATORNAME=$(xcrun instruments -s | grep $SIMULATOR | cut -d "[" -f1)
BOOTING="Rebooting $SIMULATORNAME"
fi
@stvmachine
stvmachine / main.yml
Created October 20, 2021 00:16 — forked from Shafran123/main.yml
Expo React Native Complete CI / CD Workflow Using Github Actions
name: Expo CI CD
on:
push :
branches : [release]
jobs:
Build-for-android:
runs-on: macos-latest