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
@darrenmothersele
darrenmothersele / CustomOscillator.h
Created January 26, 2021 11:39
JUCE Oscillator using Faust DSP
#pragma once
#include "unit2.h"
template <typename Type>
class CustomOscillator
{
public:
CustomOscillator() = default;
# Steps for renaming your master branch to 'main'
# Adapted from
# https://dev.to/rhymu8354/git-renaming-the-master-branch-137b
# https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx
#---------------------------------------------------------------------------------------------#
# A) - Steps if you have no remote / upstream
# B) - Steps if you are the repo owner and have a remote / upstream
# C) - Steps if you are using a repo where the upstream main branch has been renamed
toPairs(data.employees)[*].merge([1], {
id: [0],
fullName: join(' ', [[1].firstname, [1].surname]),
reverseName: join(', ', [[1].surname, [1].firstname]),
reportsTo: [1].manager && merge(get($.data.employees, [1].manager), { id: [1].manager })
})
@darrenmothersele
darrenmothersele / culturebanked.json
Created June 26, 2020 11:17
culturebanked backup
[{"blocks":[{"type":"init"},{"type":"gsheet","simple":true,"key":"https://docs.google.com/spreadsheets/d/1YIQCavPvOzTArBc1d2dlbP3bhHVHI65o3-AEHp_urXA/"},{"type":"grid","gridOptions":{}}],"id":"artWillList","workflowId":"artWillList","adapterName":"culturebanked","created":"2020-06-25T09:18:49.829Z","updated":"2020-06-25T09:18:49.829Z","modified":"2020-06-25T09:18:49.829Z","title":"Art"},{"blocks":[{"type":"form","jsonSchema":{"type":"object","properties":{"asset":{"type":"string","title":"Asset"},"width":{"type":"number","title":"Width (mm)"},"height":{"type":"number","title":"Height (mm)"},"medium":{"type":"string","title":"Medium"},"after":{"type":"string","title":"After"},"location":{"type":"string","title":"Location"},"owner":{"title":"Owner","type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"number","title":"Split"}}},"beneficiaries":{"title":"Beneficiaries","type":"array","items":{"type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"n
{
"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