Skip to content

Instantly share code, notes, and snippets.

View ktroach's full-sized avatar
🎯
Focusing

Kyle Roach ktroach

🎯
Focusing
View GitHub Profile
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { eventsToDispatch } from 'src/utils/events';
export const render = (containerId, data) => {
const container = document.getElementById(containerId);
if (!container) return;
ReactDOM.render(<App {...data} />, container);
};
// webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const WebpackShellPlugin = require('webpack-shell-plugin');
const webpack = require('webpack');
const chalk = require('chalk');
const path = require('path');
import { useEffect, useState } from 'react';
const dynamicallyInjectWidget = (id, url) => {
const scriptId = `${id}Bundle`;
const [isLoaded, setLoaded] = useState(window[id]);
const handleLoad = () => setLoaded(true);
useEffect(() => {
const existingScript = document.getElementById(scriptId);
AWSTemplateFormatVersion: 2010-09-09
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.1.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: Name
#!/bin/bash
# Deploys DocumentDb instance into a cluster within a VPC private subnet
aws --region us-west-2 cloudformation create-stack --stack-name docdb-test --template-body file://docdb-stack.yaml --parameters file://docdb-stack-params.json
/**
* Check if the given access token can invoke the specified method.
*
* @param {AccessToken} token The access token.
* @param {*} modelId The model ID.
* @param {SharedMethod} sharedMethod The method in question.
* @param {Object} ctx The remote invocation context.
* @callback {Function} callback The callback function.
* @param {String|Error} err The error object.
* @param {Boolean} allowed True if the request is allowed; false otherwise.
@ktroach
ktroach / run-samples
Last active October 9, 2015 15:59
run ramlstyle samples script
# Runs Sample files
#!/bin/bash
# project path defaults to the "ramlstyle" local project path
_project_path=`pwd`
# sample path defaults to project_dir/samples
_sample_path="${_project_path}/samples"
# filter files to process
_sample_files="${_sample_path}/sample*.raml"
@ktroach
ktroach / testgist.cs
Created March 25, 2013 04:08
test gist
using System;
public namespace testgist
{
public class TestGist
{
}