| name | no-use-effect |
|---|---|
| description | Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Create a (draft) pull request using GitHub CLI. | |
| # It assigns the PR to the current user, fills in the title from the first commit, | |
| # and uses the PR template file for the description. | |
| set -euo pipefail | |
| # Colors for output | |
| RED='\033[0;31m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this won't ever get imported on native, but we put this file here to make that clear | |
| export default ({children}) => children |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This Gist is part of a medium article - read here: | |
| * https://jamiecurnow.medium.com/using-firestore-with-more-typescript-8058b6a88674 | |
| */ | |
| // import firstore (obviously) | |
| import { firestore } from 'firebase-admin' | |
| import type { DocumentData, WithFieldValue } from 'firebase-admin/firestore' | |
| // Here's the helper type for paths: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Simple command to display the wireless strenght signal | |
| # | |
| clear | |
| while x=1 | |
| do /System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I \ | |
| | grep CtlRSSI \ | |
| | sed -e 's/^.*://g' \ | |
| | xargs -I SIGNAL printf "\rWifi dBm: SIGNAL" | |
| sleep 0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare var __DEV__: boolean; | |
| declare module 'react-native' { | |
| declare type Color = string | number; | |
| declare type Transform = | |
| { perspective: number } | | |
| { scale: number } | | |
| { scaleX: number } | |
Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.
- [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
[UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached[UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead[UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { storiesOf, action } from '@kadira/storybook'; | |
| import { makeExecutableSchema, addMockFunctionsToSchema } from 'graphql-tools'; | |
| import { mockNetworkInterfaceWithSchema } from 'apollo-test-utils'; | |
| import ApolloClient from 'apollo-client'; | |
| import { ApolloProvider } from 'react-apollo'; | |
| import InboxScreen from './InboxScreen'; | |
| import TaskList from '../components/TaskList'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with | |
| dau as ( | |
| -- This part of the query can be pretty much anything. | |
| -- The only requirement is that it have three columns: | |
| -- dt, user_id, inc_amt | |
| -- Where dt is a date and user_id is some unique identifier for a user. | |
| -- Each dt-user_id pair should be unique in this table. | |
| -- inc_amt represents the amount of value that this user created on dt. | |
| -- The most common case is | |
| -- inc_amt = incremental revenue from the user on dt |
NewerOlder