I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)
This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.
import { IntlProvider } from 'react-intl'; | |
const language = 'en'; | |
// Usually messages is declared in another file. | |
const messages = { | |
greeting: 'Hello' | |
} | |
export const mesg = defineMessages({ | |
greeting: { | |
id: 'greeting', |
os: linux | |
node_js: '12' | |
sudo: required | |
env: DISPLAY=':99.0' | |
dist: trusty | |
addons: | |
apt: | |
update: true | |
sources: | |
- google-chrome |
-import { Text, View, ListView } from 'react-native'; | |
+import { Text, View, FlatList } from 'react-native'; | |
import style from './styles'; | |
import listData from './listData'; | |
class App extends Component { | |
- constructor(props) { | |
- super(props); |
To add a simulator | |
Choose Hardware > Device > Manage Devices. | |
Xcode opens the Devices window. | |
At the bottom of the left column, click the Add button (+). | |
In the dialog that appears, enter a name in the Simulator Name text field and choose the device from the Device Type pop-up menu. | |
//by default |
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib |
#!/usr/bin/env bash | |
# Original Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
## Usage: heroku_env_copy [options] SOURCE TARGET | |
## | |
## NOTE: This script will only output the command, you should run it yourself. | |
## | |
## Options: | |
## -h, --help Display this message. | |
## |
/* | |
Let us re-create `Promise.all` | |
`Promise.all` method returns a promise that resolves when all of the promises in the iterable argument have resolved, | |
or rejects with the reason of the first passed promise that rejects. | |
Read more about `Promise.all` on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all | |
A basic example would be something like this: | |
In tests that use a database, it's necessary to clean out the tables before each run (we don't use after so we can debug a failed test's db).
Sometimes we forget the syntax though so here's what we do:
before(function truncateDatabase (done) {
// http://docs.sequelizejs.com/en/v3/docs/raw-queries/
// https://www.postgresql.org/docs/9.3/static/sql-truncate.html
// DEV: PostgreSQL doesn't support truncating all tables via a `*`
// DEV: Our query is vulnerable to SQL injection but we can't use bind and trust our table names more/less
module.exports = { | |
“extends”: “../src/.eslintrc.js”, | |
“rules”: { | |
“import/no-extraneous-dependencies”: “error” | |
} | |
}; |