Skip to content

Instantly share code, notes, and snippets.

@shumiyao
shumiyao / log.txt
Created August 10, 2019 22:05
Log of npm install (node v. 12.8.0) of gridsome on ubuntu
shu@shu-VirtualBox:~/Documents/client/backend$ npm install
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
> [email protected] install /home/shu/Documents/client/backend/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Do
@shumiyao
shumiyao / gist:a3a59983434163b093bd4c53e696b879
Created May 29, 2020 12:30
Final Cut Pro 10.4.8 + MVVK2 + 10.15.5
Process: Final Cut Pro [3482]
Path: /Applications/Final Cut Pro.app/Contents/MacOS/Final Cut Pro
Identifier: com.apple.FinalCut
Version: 10.4.8 (358560)
Build Info: ProEditor-35856000076000000~7 (15B18c)
App Item ID: 424389933
App External ID: 833677189
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Final Cut Pro [3482]
@shumiyao
shumiyao / index.js
Created June 13, 2020 17:15
Netlify CMS registerWidget ~ select box (not working)
CMS.registerWidget(
'predefined_labels',
createClass({
getDefaultProps: function () {
return {
value: ''
}
},
componentDidMount: async function () {
// const _field = this.props.field;
@shumiyao
shumiyao / gist:e2a6aab2829eb044c782df330ec6b25c
Created February 14, 2021 20:59
Dart: add value to Map conditionally by using spread
void main() {
bool test = false;
Map<String, String> myMapA = {
"a": "1",
"b": "2",
... test == true ? {"c":"3"} : {}
};
Map<String, String> myMapB = {
"a": "1",
"b": "2",
@shumiyao
shumiyao / gist:c27148ee66ec6f3c8cccf6ee9a5d0d59
Created March 24, 2021 21:22
Logic Pro Bluetooth Midi keyboard disconnection bug Log When it happened
default 21:12:16.548397+0000 bluetoothd Stop scanning for process sharingd (454) with scan request of type 16, blob: {length = 0, bytes = 0x}, mask {length = 0, bytes = 0x}, active: 0, duplicates: 0, screen on: No Scan, screen off: No Scan, locked: 1, rssi: -90, peers: (
) nearby scan mode: 10, adv buf: 0, advbuf mode: 4, priority critical: 0, range: 0
default 21:12:16.548481+0000 bluetoothd Removing scan request scan request of type 16, blob: {length = 0, bytes = 0x}, mask {length = 0, bytes = 0x}, active: 0, duplicates: 0, screen on: No Scan, screen off: No Scan, locked: 1, rssi: -90, peers: (
) nearby scan mode: 10, adv buf: 0, advbuf mode: 4, priority critical: 0, range: 0 for client 2FCCBE14-0721-4677-B445-AF5245A5477B
default 21:12:16.548607+0000 bluetoothd Passively scanning for devices of types: 5 15 18 (Window: 30/Interval: 300)
default 21:12:16.548646+0000 bluetoothd About to scan for type: 15 - rssi: -70 - range: 0 - payload: {length = 22, bytes = 0x00000000000000000000000000000000000000000000} -
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
cd template-lookbook (in your mac)
git branch -m paywall main;
git fetch origin;
git branch -u origin/main main;
git remote set-head origin -a;
git branch;
git checkout main;
@shumiyao
shumiyao / UuidControl.tsx
Last active January 28, 2023 19:46
Uuid Control widget for Static CMS
// reference https://github.com/antondb/netlify-cms-widget-uuid
import React from 'react';
import type { WidgetControlProps } from '@staticcms/core';
interface UuidField {
name: 'uuid';
widget: 'uuid';
}
const createUuid = (options = { size: 8, url: 'int8rdomaluesbj012345679cfghkpqvwxyzZ' }) => {
@shumiyao
shumiyao / gist:3b597864fd40bbcc7d2756f690281910
Last active February 9, 2023 23:27
Shortcode Test for StaticCMS (warning: this is a work in progress and incomplete)
interface TestShortcodeProps {
src: string;
}
CMS.registerShortcode<TestShortcodeProps>('test', {
label: 'test',
openTag: '[',
closeTag: ']',
separator: '|',
toProps: (args) => {
// Convert unicode string to Javascript escape
// https://stackoverflow.com/questions/21014476/javascript-convert-unicode-string-to-javascript-escape
String.prototype.toUnicode = function(){
var result = "";
for(var i = 0; i < this.length; i++){
// Assumption: all characters are < 0xffff
result += "\\u" + ("000" + this[i].charCodeAt(0).toString(16)).substr(-4);
}
return result;
};