Skip to content

Instantly share code, notes, and snippets.

View simoncollins's full-sized avatar

Simon Collins simoncollins

  • Brisbane, Australia
View GitHub Profile
@valentinalexeev
valentinalexeev / AuthProvider.js
Created January 27, 2020 11:37
React-admin v3 Firebase Auth + FirebaseUI
import * as firebase from 'firebase';
import 'firebase/auth';
import lodash from 'lodash';
const baseConfig = {
userProfilePath: 'users/',
userAdminProp: 'isAdmin',
requireAdmin: true,
};
@anaisbetts
anaisbetts / index.ts
Created August 31, 2019 00:03
Create a PostgreSQL + Hasura database in Docker with Pulumi
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
@mayank23
mayank23 / README.md
Last active June 20, 2023 20:00
Jest Mock Any Property on Window Utility - with automatic cleanup

Jest Mock Any Property on Window Utility - with automatic cleanup.

@granturing
granturing / reactive_map.js
Last active November 14, 2022 04:28
Sample reactive Leaflet code for Zeppelin
<!-- 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', {
@mindspank
mindspank / QES-NoProxy-Certs.js
Last active March 31, 2017 11:25
QES-NoProxy-Certs.js
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
},
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/

Folder Structure

Please note

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.

@somerandomnerd
somerandomnerd / EnableNaturalScrolling.scpt
Last active October 13, 2022 15:37
Quickly Enable/Disable natural scrolling on OSX
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"
@simenbrekken
simenbrekken / KeyboardShortcutsMixin.js
Created August 31, 2014 08:15
React Keyboard Shortcuts Mixin
'use strict';
var KEYS = {
enter: 13,
left: 37,
right: 39,
escape: 27,
backspace: 8,
comma: 188,
shift: 16,
@andyshinn
andyshinn / README.md
Last active March 24, 2022 06:40
CoreOS on Digital Ocean using Terraform

Terraform, CoreOS, and Digital Ocean

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.

Install Terraform

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.

Digital Ocean API Key