Jest Mock Any Property on Window Utility - with automatic cleanup.
import * as firebase from 'firebase'; | |
import 'firebase/auth'; | |
import lodash from 'lodash'; | |
const baseConfig = { | |
userProfilePath: 'users/', | |
userAdminProp: 'isAdmin', | |
requireAdmin: true, | |
}; |
import * as pulumi from '@pulumi/pulumi'; | |
import * as docker from '@pulumi/docker'; | |
import * as pg from '@pulumi/postgresql'; | |
const cfg = new pulumi.Config(); | |
const network = new docker.Network('net'); | |
const pgImg = new docker.RemoteImage('postgresql-image', { | |
name: 'postgres:11', | |
keepLocally: true |
<!-- place this in an %angular paragraph --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" /> | |
<div id="map" style="height: 800px; width: 100%"></div> | |
<script type="text/javascript"> | |
function initMap() { | |
var map = L.map('map').setView([30.00, -30.00], 3); | |
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
var WebSocket = require('ws'); | |
var fs = require('fs'); | |
var ws = new WebSocket('wss://usrad-akl:4747/app/', { | |
origin: 'https://usrad-akl', // <- This origin has to be in the WebSocket White list of Qlik Sense | |
cert: fs.readFileSync(__dirname + '/client.pem'), | |
key: fs.readFileSync(__dirname + '/client_key.pem'), | |
headers: { | |
'X-Qlik-User': 'UserDirectory=Internal;UserId=sa_repository' // Passing a user to QIX to authenticate as | |
}, |
node_modules/ |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
tell application "System Preferences" | |
activate | |
set current pane to pane "com.apple.preference.trackpad" | |
end tell | |
tell application "System Events" | |
tell process "System Preferences" | |
click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad" | |
set theCheckbox to checkbox 1 of tab group 1 of window "Trackpad" |
'use strict'; | |
var KEYS = { | |
enter: 13, | |
left: 37, | |
right: 39, | |
escape: 27, | |
backspace: 8, | |
comma: 188, | |
shift: 16, |
Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.
Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH
and testing that it works.