Skip to content

Instantly share code, notes, and snippets.

@mjyoung
mjyoung / Caddyfile
Created September 13, 2021 16:31 — forked from fu-sen/Caddyfile
Caddy v2 (Officical Docker Image) with Google Cloud Run (Freely editable Caddyfile) https://caddy.community/t/caddy-works-with-google-cloud-run/6898
:{$PORT}
root * /usr/share/caddy
# Do not rewrite up to this point!
file_server
templates
@mjyoung
mjyoung / tab.bash
Created June 8, 2017 20:08 — forked from vitalybe/tab.bash
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
@mjyoung
mjyoung / app.js
Created March 17, 2017 01:16 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@mjyoung
mjyoung / README.md
Created November 12, 2015 21:58 — forked from ngryman/README.md
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.

Please complete the following challenge and submit your response in a gist.

Write your code with the following priorities in mind, in order from most to least important:

  • Correctness and completeness
  • Clarity and readability
  • Conciseness and performance

Without further ado: