Skip to content

Instantly share code, notes, and snippets.

View darrenmothersele's full-sized avatar
🏠
Working from home

Darren Mothersele darrenmothersele

🏠
Working from home
View GitHub Profile
{
"title": "Coronavirus Dashboard",
"blocks": [
{
"type": "multi",
"batches": [
{
"blocks": [
{
"type": "init"
@darrenmothersele
darrenmothersele / coronavirus-dashboard-config.json
Last active March 26, 2020 06:52
Coronavirus Dashboard Config
{
"title": "Coronavirus Dashboard",
"blocks": [
{
"type": "multi",
"batches": [
{
"blocks": [
{
"type": "init"
@darrenmothersele
darrenmothersele / publish.md
Last active March 3, 2020 09:30
NPM publish

Publishing

The prepublish hook will ensure dist files are created before publishing. This way you don't need to commit them in your repository.

# Bump the version first
# It'll also commit it and create a tag
npm version patch -m 'MESSAGE'
@darrenmothersele
darrenmothersele / 001-setup.md
Created February 21, 2020 10:13
Setup for a Vue CLI project

1. Create project

npm install -g @vue/cli
vue create project-name

Manually select features:

  • Babel
  • Router
  • Vuex
@darrenmothersele
darrenmothersele / download-file.ts
Created February 12, 2020 05:48
Download a file in JavaScript/TypeScript (click handler for a button)
import * as stringify from 'json-stringify-safe';
const format = 'json';
const outputData = stringify(this.model);
const mimeTypes = {
'json': 'application/json',
'csv': 'text/csv',
'xml': 'text/xml',
'txt': 'text/plain'
@darrenmothersele
darrenmothersele / unsplash.md
Created January 17, 2020 15:37
Unsplash Face detection

Adding params for face detection:

&auto=format&fit=facearea&h=256&w=256&q=80&facepad=2

export interface ZipEntry {
version: number;
bitFlag: number;
compressionMethod: number;
lastModDateRaw: number;
lastModDate: string;
crc32: number;
compressedSize: number;
uncompressedSize: number;
filenameLength: number;
{
"adapterName": "mccs",
"label": "MCCS",
"description": null,
"infoUrl": null,
"supportUrl": null,
"maintainer": null,
"version": "0.1.0",
"tags": [],
"name": "mccs",
@darrenmothersele
darrenmothersele / useful.md
Last active December 6, 2019 09:29
USEFUL THINGS
@darrenmothersele
darrenmothersele / dropbox.json
Created December 3, 2019 12:06
Read file from Dropbox API and convert to a binary file
{
"adapterName": "dropbox",
"label": "Dropbox",
"description": null,
"infoUrl": null,
"supportUrl": null,
"maintainer": null,
"version": "0.0.0",
"tags": [],
"name": "dropbox",