Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Basic Barcode Reader</title>
<script type="text/javascript" src="BarcodeReader.js"></script>
<script type="text/javascript">
var defaultScanner;
// On page load create a BarcodeReader object
function setup ()
{
@johanbaaij
johanbaaij / newlines.sh
Created June 6, 2020 13:42
Display $PATH on multiple lines
echo "$PATH" | tr \: /n
@johanbaaij
johanbaaij / http-auth.conf
Created February 4, 2020 01:17 — forked from darkside/nginx_auth_basic
Protect sidekiq dashboard with nginx basic auth
location /sidekiq {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
if (!-f $request_filename) {
proxy_pass http://dokku-app-name:5000;
break;
}
}
@johanbaaij
johanbaaij / Home.spec.ts
Last active February 1, 2020 11:08
composition-api TypeError
import "./setup";
// Dependencies
import Vuetify from "vuetify";
import VueCompositionApi from "@vue/composition-api";
import i18n from "@/plugins/i18n";
import store from "@/store";
// Components
import Home from "../../src/views/Home.vue";
import { Vue } from "vue/types/vue";
interface AuthOptions {
params?: {};
success?: () => void;
error?: () => void;
}
type Redirect = { path: string } | string;
remote: + [[ =====> Downloading Buildpack: https://github.com/dokku/buildpack-nginx == --* ]]
remote: + [[ =====> Downloading Buildpack: https://github.com/dokku/buildpack-nginx == ==* ]]
=====> Downloading Buildpack: https://github.com/dokku/buildpack-nginx
=====>' Downloading Buildpack: https://github.com/dokku/buildpack-nginx
remote: + read -r line
remote: + [[ ! -f /tmp/build/.static ]]
remote: + exit 1
remote: + rm -rf /tmp/dokku-21039-git_build_app_repo.hmTeKw
remote: + exit_code=1
remote: + set -e
@johanbaaij
johanbaaij / tapTempo.js
Created October 1, 2019 05:07
Reasonably clever tap-tempo by Damien Clarke but as a Vue mixin
// Simplified version of this codepen https://codepen.io/dxinteractive/pen/bpaMMy authored by Damien Clark
const TOTAL_TAP_VALUES = 5
const MS_UNTIL_CHAIN_RESET = 2000
const SKIPPED_TAP_THRESHOLD_LOW = 1.75
const SKIPPED_TAP_THRESHOLD_HIGH = 2.75
export default {
data() {
return {