Skip to content

Instantly share code, notes, and snippets.

~/dev/qmk_firmware on choc2 ❯ util/docker_build.sh sofle_choc:default
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
QMK Firmware 0.20.5
Making sofle_choc with keymap default
avr-gcc (GCC) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@brianlow
brianlow / _vscode_and_minitest.md
Last active May 25, 2020 23:06
Tasks for VSCode + MiniTest

Press CMD+r to run tests in a VSCode terminal:

  • Run test at cursor
  • Run all test in the current file
  • Re-run the last test run

To install:

  • VSCode -> command palette -> Configure Task.. -> paste in tasks.json
  • VSCode -> command palette -> Open Keyboard Shortcuts (JSON) -> paste
[
@brianlow
brianlow / kafka-from-cli.md
Last active May 30, 2018 01:38 — forked from crcastle/kafka-from-cli.md
Kafka CLI example using Apache Kafka on Heroku
@brianlow
brianlow / varnish3.rb
Last active January 7, 2019 17:55 — forked from aslam/varnish3.rb
Install Varnish-3.0.7 on OSX with homebrew
##
# Install Varnish 3.0.7 on OSX with the following Brew command:
# $> brew install https://gist.github.com/brianlow/674897ef935c2aae2f6cdae41c17766f/raw/varnish.rb
#
# You also might have to run:
# $> sudo brew link varnish3
# To symlink the install.
##
require 'formula'
curl -X "GET" "https://api.wit.ai/message?q=hi" \
	-H "Authorization: Bearer [token]" \
	-H "Accept: application/vnd.wit.20160526+json"

Sometimes returns this (good):

{
  1. Create new bot using the wit.ai website

  2. Run commands below, waiting for green training indicator between each step.

  3. Create intent

curl -X "POST" "https://api.wit.ai/entities" \
	-H "Accept: application/vnd.wit.20160526+json" \
	-H "Authorization: Bearer [token]" \
@brianlow
brianlow / copy_playlist_to_my_music.rb
Last active December 28, 2015 06:09
Spotify: Copy all songs from all your playlists into 'Your Music' (songs / albums / artists)
# Add an application at https://developer.spotify.com/my-applications
# Whitelist redirect url http://posthere.io/brians-importer
# Copy client id into url below
# https://accounts.spotify.com/authorize?client_id=4260a40e3f514766802819f094e3be82&redirect_uri=http%3A%2F%2Fposthere.io%2Fbrians-importer&response_type=token&scope=playlist-read-private%20playlist-modify-public%20playlist-modify-private%20user-library-read%20user-library-modify
# Browse to URL
# On successful authorization, you will be redirected, from this URL copy the token param in variable below
require 'httparty'
token = '... your token here ...'
### Keybase proof
I hereby claim:
* I am brianlow on github.
* I am brianlow (https://keybase.io/brianlow) on keybase.
* I have a public key whose fingerprint is 0288 6EAD 4693 8368 DF86 798D 2B90 84AA 83D7 20FE
To claim this, I am signing this object:
@brianlow
brianlow / gist:0d5d2070c87c378454d7
Created September 16, 2014 01:46
rmdir deletes children through junction
D:\temp\test> mkdir source
#
#
# Directory: D:\temp\test
#
#
# Mode LastWriteTime Length Name
# ---- ------------- ------ ----
# d---- 9/15/2014 7:42 PM source
#
#
# Copy logs from the vagrant share (hosted by Windows) to ~/logs
# This is because logstash tracks files using their inode number
# but this number may change each time the vm is booted.
#
# rsync options
# -r recursive
# -t transfer file mod times and use to skip files
# -v verbose
# --inplace update files rather than write new and rename