This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e; | |
mongoOne=f06668aa36714d818dfc2105e103f647; | |
mongoTwo=ea623889303a4e1cb25e7bf2e9b8285c; | |
function onExit() | |
{ | |
docker kill $mongoOne; | |
docker kill $mongoTwo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e; | |
# Set up a single-node Kubernetes system on Debian 10 (Buster). | |
# Use Flannel as the network fabric. Install the Kubernetes | |
# dashboard. | |
# disable swap | |
swapoff -a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
########################################################## | |
# Install script for Docker-CE on ElementaryOS 0.4.1 Loki | |
# Had to update the repository to point to xenial instead | |
# of using 'lsb_release -cs' because there's no loki | |
# repository at download.docker.com. | |
########################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'UPDATE PACKAGE INDEX...'; | |
sudo apt-get update; | |
echo;echo;echo;echo 'INSTALL PACKAGES TO ALLOW APT TO USE A REPOSITORY OVER HTTPS...' | |
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common; | |
echo;echo;echo;echo 'ADD GPG KEYS...'; | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o nounset; | |
################################################################################# | |
# Script to generate a private key and pfx. | |
# Requires the variable $FileName to be set. | |
# Remember to `chmod +x makecert.sh` in order to run. | |
# Example: FileName=myfile ./makecert.sh | |
# This will generate myfile.key, myfile.csr, myfile.crt, and myfile.pfx | |
################################################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I use this to hijack AJAX requests to subdomains of the site that rely on CORS to function. I want the host | |
// names to look like they are from the same host but swap out a local server for testing. | |
// Add this if-statement to the OnBeforeRequest method. It ignores CONNECT methods to allow HTTPS handshake. | |
// All other requests will be redirected to localhost over HTTP. | |
if (!oSession.HTTPMethodIs("CONNECT") && oSession.HostnameIs("my.public.site.com")) | |
{ | |
oSession.host = "localhost:10010" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* GMail's image proxy gets in the way when testing emails that are coming from testing websites that we do not expose | |
* to the general internet. This bookmarklet code will remove the proxy in the URI of all HTML img tags on the current | |
* page and update the src attribute with the non-proxy version of the content URI. All src tags that do not use the | |
* Google User Content proxy service will be left alone. To use this, copy the code into the URL field of a new bookmark | |
* in your browser. Then, when looking at an email that has images provided by the proxy, click the bookmark and the | |
* images should appear. | |
*/ | |
javascript:(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I have a collection of view models and I want to track a property on each of them to notify the parent. | |
However, if the child is removed from the array, the view model will live in memory with no hope of garbage | |
collection because there is still a subscriber that has a reference to it. | |
To solve this, I've added a .dispose() method on the view model that will iterate over the change subscriptions | |
on properties that I know will be subscribed to by higher view models and dispose of the subscriptions from here. | |
That way I don't have to track the subscriptions in the higher view model. All I have to do is call the .dispose() | |
method on an item if I remove it from the array. |