- Install prettier
- Make a .prettierignore file, and add directories you'd like prettier to not format, for example:
**/node_modules
- Run
prettier --write "**/*.js"
*Don't forget the quotes. - Optional: if you want to format JSON/SCSS files too, replace js with json/scss.
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
/** | |
* Created by nirlevy on 02/07/2017. | |
* MIT Licence | |
*/ | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Animated, Easing } from 'react-native'; | |
export class RotatingView extends Component { | |
state = { |
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
javascript:(function(){ localStorage.clear(); sessionStorage.clear(); var c = document.cookie.split("; "); for (i in c) { document.cookie =/^[^=]+/.exec(c[i])[0]+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; }; })(); |
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 { StyleSheet, Text, View } from 'react-native'; | |
import { BarCodeScanner } from 'expo'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<BarCodeScanner | |
onBarCodeRead={(scan) => alert(scan.data)} | |
style={[StyleSheet.absoluteFill, styles.container]} |
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
# -*- coding: utf-8 -*- | |
#python 3.x | |
import csv | |
import sys | |
#convert a "comma separated values" file to vcf contact cards. I used this to convert a list of student | |
#names and phone numbers into a vcf and save the trouble of adding one by one through phone | |
#USAGE: |
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
export shortVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ios/myapp/Info.plist ); | |
export bundleVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleVersion" ios/myapp/Info.plist ); | |
export distName=MyApp-$shortVersion-$bundleVersion |
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
// EmailInput wraps an HTML `input` and adds some app-specific styling. | |
const EmailInput = React.forwardRef((props, ref) => ( | |
<input ref={ref} {...props} type="email" className="AppEmailInput" /> | |
)); | |
class App extends Component { | |
emailRef = React.createRef(); | |
render() { | |
return ( |
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 sample is a Work in Progress for JSI , and specific functions may change. | |
#pragma once | |
#include <string> | |
#include <unordered_map> | |
#include <jsi/jsi.h> | |
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS. |
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
# 1. Unlock keychain for auto-signing package * | |
security unlock-keychain -p <your-admin-password> ~/Library/Keychains/login.keychain | |
# 2. Build JS-bundle to Xcode project | |
react-native bundle --entry-file='index.js' --bundle-output='./ios/<your-app-name>/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios' | |
# 3. Building an archive | |
xcodebuild -project ./ios/<your-project-name>.xcodeproj -scheme '<your-scheme-name>' -derivedDataPath ./ios/build -archivePath ./ios/archive/<your-app-name>.xcarchive archive | xcpretty | |
# 4. Export the archive to an *.ipa package |