Skip to content

Instantly share code, notes, and snippets.

View SegersIan's full-sized avatar

Segers Ian SegersIan

View GitHub Profile
function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
function myFunctionThatCatches() {
try {
return thisThrows();
} catch (e) {
// Maybe do something else here first.
throw e;
function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
function myFunctionThatCatches() {
try {
return thisThrows();
} catch (e) {
throw new TypeError(e.message);
} finally {
async function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
try {
thisThrows();
} catch (e) {
console.error(e);
} finally {
console.log('We do cleanup here');
[server]
domain = storyclub.ai
root_url = %(protocol)s://%(domain)s:%(http_port)s/admin/
serve_from_sub_path = true
const {
generateBlobSASQueryParameters,
StorageSharedKeyCredential,
ContainerSASPermissions,
SASProtocol
} = require('@azure/storage-blob');
/**
* These are the 4 variables that matter
@SegersIan
SegersIan / Store.js
Created September 14, 2017 15:41
How to handle updates on a single item in an array located in the Vuex store.
import vuex from 'vuex';
import vue from 'vue';
import * as api from './api';
vue.use(vuex);
export default new vuex.Store({
state: {
users: []
@SegersIan
SegersIan / tutorial.md
Created July 23, 2018 15:25 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

async function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
async function myFunctionThatCatches() {
try {
return thisThrows();
} catch (e) {
console.error(e);
} finally {
<!DOCTYPE html>
<html>
<body>
<label for="volume">Volume:</label>
<input name="volume" type="range" id="volume" min="0" max="127">
<button id="play">Play/Pause</button>
<script>
<!DOCTYPE html>
<html>
<body>
<label for="volume">Volume:</label>
<input name="volume" type="range" id="volume" min="0" max="127">
<script>
const volumeSlider = document.getElementById('volume');