Skip to content

Instantly share code, notes, and snippets.

View ben-joostens's full-sized avatar

Ben Joostens ben-joostens

View GitHub Profile
@ben-joostens
ben-joostens / tourney.html
Created November 14, 2022 12:08 — forked from sterlingwes/tourney.html
Tournament Bracket Generator (Javascript + CSS, no tables)
<!DOCTYPE html>
<html>
<head>
<title>Tournament Bracket Generator</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script>
$(document).on('ready', function() {
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes)
@ben-joostens
ben-joostens / debounce.js
Created July 21, 2020 14:08 — forked from ethyde/debounce.js
JS Native debounce function
// from : http://qnimate.com/javascript-limit-function-call-rate/
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this,
args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
checkout-d34ae641a2.min.js:1 Uncaught TypeError: Cannot read property 'gross' of undefined
at basketTotalIsZero (checkout-d34ae641a2.min.js:1)
at t._wrappedGetters.(/en-us/checkout/anonymous function).t._wrappedGetters.(anonymous function) (https://affinity.store/static/js/vendor.min.js:1:188643)
at vt.a.(/en-us/checkout/anonymous function) (https://affinity.store/static/js/vendor.min.js:1:186748)
at Mo.get (checkout-d34ae641a2.min.js:1)
at Mo.evaluate (checkout-d34ae641a2.min.js:1)
at vt.basketTotalIsZero (checkout-d34ae641a2.min.js:1)
at Object.get [as basketTotalIsZero] (vendor.min.js:1)
at l (<anonymous>:1:1915)
at l (<anonymous>:1:1912)
@ben-joostens
ben-joostens / gist:e2a288b4c7723abe2ea2
Created July 14, 2015 22:28
SSH keychain for config.fish
if status --is-interactive;
keychain ~/.ssh/id_rsa
[ -e $HOME/.keychain/$HOSTNAME-fish ]; and . $HOME/.keychain/$HOSTNAME-fish
[ -e $HOME/.keychain/$HOSTNAME-fish-gpg]; and . $HOME/.keychain/$HOSTNAME-fish-gpg
end
@ben-joostens
ben-joostens / gist:a8293bf921a627ae7829
Created July 14, 2015 17:25
Start TMUX when logging in (fish shell)
#
# From: http://unix.stackexchange.com/questions/121401/how-can-i-start-tmux-automatically-in-fish-shell-while-connecting-to-remote-serv
#
if status --is-login
set PPID (echo (ps --pid %self -o ppid --no-headers) | xargs)
if ps --pid $PPID | grep ssh
tmux has-session -t remote; and tmux attach-session -t remote; or tmux new-session -s remote; and kill %self
echo "tmux failed to start; using plain fish shell"
end
end

Keybase proof

I hereby claim:

  • I am ben-joostens on github.
  • I am benjoostens (https://keybase.io/benjoostens) on keybase.
  • I have a public key whose fingerprint is 4CEA A5DF F744 5BF4 86EC 107C FC5F 3E8C E2EA 033B

To claim this, I am signing this object:

@ben-joostens
ben-joostens / Nginx vhost
Last active December 15, 2015 08:09
Vhost for nginx which avoids the evil "if"
server {
listen 80;
server_name laravel.app;
access_log /var/log/nginx/laravel/access.log;
error_log /var/log/nginx/laravel/error.log;
root /www/laravel/public;
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;