Skip to content

Instantly share code, notes, and snippets.

View warrenseine's full-sized avatar
💭
🥇

Warren Seine warrenseine

💭
🥇
View GitHub Profile
@warrenseine
warrenseine / duplicate-tab.user.js
Created March 21, 2024 15:28
Duplicate current tab with Cmd + D
// ==UserScript==
// ==UserScript==
// @name Duplicate tab
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Duplicate current tab with Cmd + D
// @author Warren Seine
// @match *://*/*
// @grant none
// ==/UserScript==
@warrenseine
warrenseine / keycloak-auto-login.user.js
Last active July 6, 2023 13:55
Tampermonkey Keycloak Auto-Login
// ==UserScript==
// @name Keycloak Auto-Login
// @namespace http://tampermonkey.net/
// @include /^https:\/\/.*\/auth\/realms\/.*\/(saml|auth)\?/
// @version 1.0
// @author Warren Seine
// @description Auto-login on Keycloak
// @icon https://upload.wikimedia.org/wikipedia/commons/2/29/Keycloak_Logo.png
// ==/UserScript==
@warrenseine
warrenseine / docker-vz.yaml
Last active January 26, 2023 15:43
Lima configuration for macOS Ventura with Virtualization.framework + virtiofs + Docker
# Example to use Docker instead of containerd & nerdctl
# $ limactl start ./docker.yaml
# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
# Example to run ubuntu using vmType: vz instead of qemu (Default)
# This example requires Lima v0.14.0 or later and macOS 13.
@warrenseine
warrenseine / one-login-auto-login.user.js
Last active August 20, 2022 08:47
Tampermonkey OneLogin Auto-Login
// ==UserScript==
// @name OneLogin Auto-Login
// @namespace http://tampermonkey.net/
// @match https://*.onelogin.com/login2/*
// @version 1.0
// @author Warren Seine
// @description Auto-login on OneLogin if password is auto-filled
// @icon https://www.google.com/s2/favicons?sz=64&domain=onelogin.com
// ==/UserScript==
@warrenseine
warrenseine / aws-vpn-auto-close.user.js
Last active January 24, 2023 12:40
Tampermonkey AWS VPN Auto-Close
// ==UserScript==
// @name AWS VPN Auto-Close
// @namespace http://tampermonkey.net/
// @match http://127.0.0.1/
// @grant window.close
// @version 1.0
// @author Warren Seine
// @description Close the tab when successful AWS VPN is on
// @icon https://a0.awsstatic.com/libra-css/images/site/fav/favicon.ico
// ==/UserScript==
@warrenseine
warrenseine / Makefile
Last active August 29, 2015 14:19
Emscripten size comparison between <iostream>, fprintf, and write
all: hello-fprintf.html hello-iostream.html hello-write.html
hello-fprintf.html: hello-fprintf.cpp
em++ -std=c++11 -O2 hello-fprintf.cpp -o hello-fprintf.bc
emcc -O2 hello-fprintf.bc -o hello-fprintf.html
hello-iostream.html: hello-iostream.cpp
em++ -std=c++11 -O2 hello-iostream.cpp -o hello-iostream.bc
emcc -O2 hello-iostream.bc -o hello-iostream.html
@warrenseine
warrenseine / Makefile
Created April 22, 2015 10:10
iOS 8.1 Emscripten issue with std::chrono
main.html: main.cpp
em++ -std=c++11 -O2 main.cpp -o main.bc
emcc -O2 main.bc -o main.html
clean:
rm -f main.bc main.js main.html main.html.map main.html.mem
@warrenseine
warrenseine / bfg.sh
Created September 13, 2014 08:12
Protect all branches when running The BFG
#!/bin/bash
set -x
set -e
BFG_URL="http://repo1.maven.org/maven2/com/madgag/bfg/1.11.7/bfg-1.11.7.jar"
BFG_BIN=`basename ${BFG_URL}`
BFG="/tmp/${BFG_BIN}"
[[ -n "$1" ]] || {
@warrenseine
warrenseine / install_emscripten.sh
Created June 24, 2014 10:26
Install Emscripten from source or emsdk
#!/bin/bash
# Copyright (c) 2014 Aerys
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@warrenseine
warrenseine / gist:6251739
Last active December 21, 2015 04:48
Get the bounding box of a group with Minko.
public function getBoundingBoxOfGroup(group : Group) : BoundingBox
{
var min : Vector4 = new Vector4(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
var max : Vector4 = new Vector4(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE);
for each (var mesh : Mesh in group.getDescendantsByType(Mesh))
{
var worldMin : Vector4 = mesh.localToWorld(
mesh.geometry.boundingBox.min, null, false, true
);