- Generate new rails app using
--webpack
flag
rails new myApp --webpack=vue
Note:
- You can use
--webpack=angular
for angular application and--webpack=react
for react.
import { useState, useEffect } from "react"; | |
import { AsyncStorage } from "react-native"; | |
function useAsyncStorage(key, initialValue) { | |
const [storedValue, setStoredValue] = useState(initialValue); | |
useEffect(() => { | |
AsyncStorage.getItem(key) | |
.then(value => { | |
if (value === null) return initialValue; |
# .github/workflows/main.yaml | |
name: Main | |
on: [push] | |
jobs: | |
vm-job: | |
name: CI | |
runs-on: ubuntu-latest |
#! /usr/bin/env ruby | |
# This script can be used to parse and dump the information from | |
# the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
# | |
# It dumps all cell phone call + SMS message + MMS records, plus a summary of each. | |
# | |
# Place this script inside the extracted Facebook data download folder | |
# alongside the 'html' folder. | |
# |
FROM ruby:2.4 | |
## In case of postgresql for heroku: | |
# RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/postgeresql.list \ | |
# && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | |
# && apt-get update \ | |
# && apt-get update \ | |
# && apt-get install -y --no-install-recommends \ | |
# postgresql-client-9.6 pv ack-grep ccze unp htop vim \ | |
# && rm -rf /var/lib/apt/lists/* \ |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
stats = Sidekiq::Stats.new | |
stats.queues | |
stats.enqueued | |
stats.processed | |
stats.failed |
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |