| service cloud.firestore { | |
| match /databases/{database}/documents { | |
| // USERS // | |
| function isAuthenticated() { | |
| return request.auth != null; | |
| } | |
| function userExists(uid) { |
| import createHoverMonitor from './createHoverMonitor'; | |
| import { element, func, oneOfType } from 'prop-types'; | |
| import React, { Component } from 'react'; | |
| const hover = createHoverMonitor(); | |
| /** | |
| * Use: | |
| * <Hoverable> | |
| * {(hover) => <View style={hover && styles.hovered} />} |
Taking two video clips, placing them side by side, combining 4 channels of audio into 2, and output.
ffmpeg -i video1.MP4 -i video2.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[v]; [0:a][1:a]amerge[a]" -map "[v]" -map "[a]" -ac 2 output.mp4
This was done with two filters and the audio from both inputs.
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import * as mobx from 'mobx-react'; | |
| import {state, actions} from './store'; | |
| // passing function to observer (with implicit inject) is not supported natively, so make up your own one | |
| // pass either function or plain old selector strings array | |
| // WARNING: doesn't work if "observer" used as decorator | |
| let observer = (selector, Component) => { |
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
- SUIT CSS naming conventions + SUIT CSS design principles;
- PostCSS + CSSNext. Future CSS syntax like variables, nesting, and autoprefixer are good enough;
- Flexbox is awesome. No need for grid framework;
- Normalize.css, base styles and variables are solid foundation for all components;
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
| import React from 'react' | |
| import { render } from 'react-dom' | |
| import { Router, browserHistory, match } from 'react-router' | |
| import createStore from '../shared/lib/create-store.js' | |
| import ContextProvider from '../shared/lib/context-provider.js' | |
| import { fetchDataOnLocationMatch } from '../shared/lib/fetch-data.js' | |
| import Root from './Root.jsx' | |
| import routes from '../shared/routes.jsx' | |
| import { AppContainer } from 'react-hot-loader' | |
| import { observable, computed, autorun } from 'mobx' |
-
brew install gnupg, pinentry-mac(this includes gpg-agent and pinentry) -
Generate a key:
$ gpg --gen-key -
Take the defaults. Whatevs
-
Tell gpg-agent to use pinentry-mac:
$ vim ~/.gnupg/gpg-agent.conf
| # In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
| # variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
| # in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
| # gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else |