Skip to content

Instantly share code, notes, and snippets.

@dbaba
dbaba / howto.md
Last active October 10, 2020 03:36
Clean-Reinstall Catalina without losing the User Data when Time Machine is unavailable.

Symptoms

  • Upgrading a Mac from Catalina 10.15.6 to 10.15.7 failed with a dialog saying "An error occurred while generating the kernel cache" having "Restart" button.
  • The Mac was no longer able to start in Safe Mode (seemed to cause a kernel panic).
  • It could start in all Recovery Modes (⌘+R/option+⌘+R/Shift+option+⌘).
  • But installing Catalina with retaining the user data ALWAYS failed with the same error in each Recovery Mode.
  • It could not boot macOS in an external drive (ALWAYS failed)

What I want to do

// Fontawesome 5 with Nuxtjs and Bulma
// Revised version of https://medium.com/@kkostov/adding-bulma-with-fontawesome-to-a-nuxt-js-project-bd101adb8778
```
$ npm i bulma @fortawesome/fontawesome-free
```
`nuxt.conf.js`
```
/*
[
{
"id": "b95be41e.e579a8",
"type": "tab",
"label": "サンプルフロー"
},
{
"id": "e5827617.1a7d88",
"type": "ui_tab",
"z": "b95be41e.e579a8",
[
{
"id": "b95be41e.e579a8",
"type": "tab",
"label": "Welcome Flow"
},
{
"id": "e5827617.1a7d88",
"type": "ui_tab",
"z": "b95be41e.e579a8",
@dbaba
dbaba / start_haproxy.sh
Last active December 2, 2015 05:40
A bash script for running HAProxy as a Docker container with hot reloading support
#!/usr/bin/env bash
# A bash script for running HAProxy as a Docker container with hot reloading support
#
# For example:
# $ docker run --name lb -p 80:8080 -p 443:8443 \
# --log-driver=json-file --log-opt max-size=100M \
# --log-opt max-file=1 \
# -v $(pwd):/usr/local/etc/haproxy -tid \
# haproxy:1.6 /usr/local/etc/haproxy/start_haproxy.sh
@dbaba
dbaba / install-nodejs-rpi.sh
Created October 21, 2015 01:33
Installing Node.js v4.0.0+ on Raspberry Pi
#!/usr/bin/env bash
# v4.0.0+ is available
VERSION=v4.1.2
# Set armv7l for RPi2
ARCH=armv6l
wget https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-${ARCH}.tar.gz
tar xf node-${VERSION}-linux-${ARCH}.tar.gz
rm -f node-${VERSION}-linux-${ARCH}/*
#!/usr/bin/env sh
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/create-bundle.sh
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/yaml-to-plist.rb
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/info.plist
chmod 755 create-bundle.sh
chmod 755 yaml-to-plist.rb
./create-bundle.sh
@dbaba
dbaba / peripheral-explorer.js
Last active October 11, 2015 03:56
An independent sample code from https://github.com/sandeepmistry/noble
// perform `npm install noble async` prior to running this.
var async = require('async');
var noble = require('noble');
var peripheralId = process.argv[2];
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning([], true);
} else {
// perform `npm install noble` prior to running this.
var noble = require('noble');
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning([], true);
} else {
noble.stopScanning();
}
});
@dbaba
dbaba / beforeeach.js
Created September 29, 2015 04:57
sinon-chrome0.2.1 with PhantomJS 2.0.0 workaround for an issue where PhantomJS ignores chai's AssertionError.
// sinon-chrome (https://github.com/vitalets/sinon-chrome/blob/master/example/test/beforeeach.js)
var fs = require('fs');
var page;
var beforeLoadFn;
beforeEach(function() {
page = require('webpage').create();
/**
* evaluate a function in the page
* @param {function} func the function to evaluate