https://npm.im/selenium-standalone doesn't work with recent versions of JDK and will cause Nightwatch to explode.
- Install JDK version 8
- Add this to your shell's profile:
export JAVA_HOME=/usr/libexec/java_home -v 1.8
SELECT | |
u.id, | |
u.user_login, | |
concat('{ ' , group_concat(concat(m.meta_key, ': ''', m.meta_value, '''')) , ' }' ) AS meta | |
FROM | |
wp_users AS u | |
JOIN | |
wp_usermeta AS m | |
WHERE | |
u.id = m.user_id |
https://npm.im/selenium-standalone doesn't work with recent versions of JDK and will cause Nightwatch to explode.
export JAVA_HOME=/usr/libexec/java_home -v 1.8
import { Dimensions, PixelRatio } from 'react-native' | |
const { width, height } = Dimensions.get(`window`) | |
export const vw = size => size * width / PixelRatio.getPixelSizeForLayoutSize(100) / PixelRatio.get() | |
export const vh = size => size * height / PixelRatio.getPixelSizeForLayoutSize(100) / PixelRatio.get() | |
export const vmin = Math.min(vw, vh) | |
export const vmax = Math.max(vw, vh) |
import React, { Fragment } from 'react' | |
import { Dimensions } from 'react-native' | |
import { connect } from 'react-redux' | |
class DimensionWatcher extends React.Component { | |
handleDimensionsChange = dimensions => this.props.dispatch({ | |
type: `DIMENSIONS_CHANGED`, | |
payload: dimensions, | |
}) |
import React, { Fragment } from 'react' | |
import { Dimensions } from 'react-native' | |
export default class ScreenMediaQuery extends React.Component { | |
state = { | |
dimensions: { | |
width: Dimensions.get(`window`).width, | |
height: Dimensions.get(`window`).height, | |
mode: Dimensions.get(`window`).width > Dimensions.get(`window`).height ? `landscape` : `portrait`, | |
}, |
const isNumeric = value => (value == Number(value)) ? 'number' : 'string' // eslint-disable-line | |
let keys = [] | |
let prependable = '' | |
const flatMap = obj => { | |
Object | |
.keys(obj) | |
.forEach(key => { | |
if (typeof obj[key] !== 'object' && isNumeric(key) !== 'number') { | |
keys.push(`${prependable}${key}`) |
<?php | |
// Initialize database connection | |
$db = new PDO('mysql:host=localhost;dbname=phpcrud;charset=utf8mb4', 'root', ''); | |
switch ($argv[1]) { | |
// CREATE | |
case 'create': | |
$stmt = $db->prepare("INSERT misc SET some_string=?"); | |
$stmt->execute([$argv[2]]); |
app.use(async (ctx, next) => { | |
try { | |
await next() | |
ctx.body = normalizeInterface(ctx) | |
} catch (err) { | |
ctx.body = normalizeInterface(ctx, err) | |
} | |
}) | |
app.use(async (ctx) => { |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
</head> | |
<body> | |
<pre></pre> |
const postcss = require('postcss') | |
const parser = require('postcss-values-parser') | |
module.exports = postcss.plugin('postcss-ratios', function (opts) { | |
opts = opts || {} | |
return (css, result) => { | |
css.walkRules(rule => { | |
rule.walkDecls(decl => { | |
decl.value = parser(decl.value, { loose: true }) |