Skip to content

Instantly share code, notes, and snippets.

@chaseholdren
chaseholdren / Dockerfile
Last active June 26, 2019 00:08
Create Firebase CLI container in your cloud workspace.
# use latest Node LTS
FROM node:lts
# install Firebase CLI
RUN npm install -g firebase-tools
ENTRYPOINT ["/usr/local/bin/firebase"]
{
"steps": [
{
"name": "gcr.io/cloud-builders/npm",
"args": [
"install"
]
},
{
"name": "gcr.io/cloud-builders/npm",
{
"steps": [
{
"name": "gcr.io/cloud-builders/npm",
"args": [
"install"
]
},
{
"name": "gcr.io/cloud-builders/npm",
// In response to the following article:
// https://www.jimhribar.com/adventures-in-async-await/
//
// Using Javascripts Object.map function, it's possible to get an array of promises
// which can then be awaited simultaneously, which will execute all of them in parallel.
//
// This is faster than the looping approach in the article, which awaits each Promise individually.
//
// Console output:
// parallelJob: 501.226ms
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"jsxSingleQuote": true,
"arrowParens": "always",
"printWidth": 120,
"tabWidth": 2
}
const MeleeCharacters = {
bowser: {
name: 'Bowser',
id: 5,
tierPosition: 8,
colors: ['green', 'blue', 'black', 'red'],
defaultColor: 'green',
},
donkeyKong: {
name: 'Donkey Kong',
const process = require("process");
const fs = require("fs");
const path = require("path");
const child_process = require("child_process");
const targetFileOrFolder = path.resolve(...process.argv);
console.log(targetFileOrFolder);
const runShellCommand = (command, ...args) => {
import React from "react";
class ArticleList extends React.Component {
constructor(props) {
super(props);
this.state = { articles: [] };
}
async componentDidMount() {
const result = await fetch("http://sample.com/");
@chaseholdren
chaseholdren / index.ts
Created September 12, 2019 11:51
ttw-time-to-work
import * as GoogleMaps from '@google/maps';
import { config } from 'dotenv';
// @ts-ignore
import { Firestore, Timestamp } from '@google-cloud/firestore';
const environment = config().parsed as {
GOOGLE_APPLICATION_CREDENTIALS: string;
MAPS_API_KEY: string;
};
@chaseholdren
chaseholdren / .gitignore_global
Last active October 26, 2020 02:35
Run the following command to set your global gitignore: `git config --global core.excludesfile ~/.gitignore_global`
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf