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
# Creating app | |
rails new name | |
# Start server | |
rails server (s) [ -b $IP [-p $PORT] ] | |
# Scaffold (add model) | |
rails generate scaffold name attribute:type |
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
upstream puma_<%= fetch(:nginx_config_name) %> { <% | |
flags = 'fail_timeout=0' | |
@backends = [fetch(:puma_bind)].flatten.map do |m| | |
etype, address = /(tcp|unix|ssl):\/{1,2}(.+)/.match(m).captures | |
if etype =='unix' | |
"server #{etype}:#{address} #{fetch(:nginx_socket_flags)};" | |
else | |
"server #{address.gsub(/0\.0\.0\.0(.+)/, "127.0.0.1\\1")} #{fetch(:nginx_http_flags)};" | |
end | |
end |
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
/* eslint-disable camelcase */ | |
import React, { Component } from 'react' | |
import { Image, TouchableOpacity, Text, View } from 'react-native' | |
import AuthActions from '../Redux/AuthRedux' | |
import { connect } from 'react-redux' | |
import FBSDK from 'react-native-fbsdk' | |
import Styles from './Styles/DrawerContentStyles' | |
import { DrawerItems } from 'react-navigation' |
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
# Ruby CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-ruby/ for more details | |
defaults: &defaults | |
working_directory: ~/split_app | |
parallelism: 2 | |
docker: | |
- image: circleci/ruby:2.5.0-node-browsers |
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
The common reason for this has something to do with shut down. When you shut down your PC or terminate your console(like Terminal in Mac) with your local server that using pg open, the error will occur. | |
As this https://stackoverflow.com/a/21420719/10738100 says, first try to remove PID file. | |
rm /usr/local/var/postgres/postmaster.pid | |
brew services restart postgresql |
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
root# apt-get update | |
root# apt-get upgrade | |
// dependencies for Ruby | |
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \ | |
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \ | |
libpcre3-dev unzip | |
// Node.js v7 | |
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - |
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
`yarn add actioncable` | |
import ActionCable from 'react-native-actioncable' | |
const cable = ActionCable.createConsumer('ws://localhost:3000/cable'); | |
export default class Room extends Component { | |
componentDidMount () { | |
this.subscription = cable.subscriptions.create( | |
'ChannelName', |
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, { useState, useEffect, useMemo, useCallback, useRef } from 'react'; | |
import { Alert, Platform } from 'react-native'; | |
import { MaterialCommunityIcons } from '@expo/vector-icons'; | |
import * as DocumentPicker from 'expo-document-picker'; | |
import convertToDraftJSON from 'plain-text-to-draftjs'; | |
import { replaceMentionValues } from 'react-native-controlled-mentions'; | |
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; | |
import { EmojiType } from 'rn-emoji-keyboard/lib/typescript/src/types'; |