Skip to content

Instantly share code, notes, and snippets.

View BrendanThompson's full-sized avatar
🍏
Getting rejected by Apple

Brendan Thompson BrendanThompson

🍏
Getting rejected by Apple
View GitHub Profile
@BrendanThompson
BrendanThompson / compareHost.ps1
Created September 30, 2014 01:22
Compare two host names to confirm if they return the same IP Address
function compareHost() {
param
(
[Parameter(Mandatory=$true)]
[string] $firstHost,
[Parameter(Mandatory=$true)]
[string] $secondHost
)
if($((Test-Connection $firstHost -Count 1).IPV4Address.IPAddressToString) -eq $((Test-Connection $secondHost -Count 1).IPV4Address.IPAddressToString)) {
@BrendanThompson
BrendanThompson / vulnBash.sh
Created September 25, 2014 01:24
Check for Vulnerable Bash
env t='() { :;}; echo You are vulnerable.' bash -c "true"
{
"template": "logstash*",
"settings": {
"index.analysis.analyzer.default.stopwords": "_none_",
"index.number_of_replicas": "1",
"index.query.default_field": "message",
"index.refresh_interval": "5s",
"index.number_of_shards": "4",
"index.store.compress.stored": "true",
"index.analysis.analyzer.default.type": "standard",

#Test

This is just a test to see how the gist stuff works from ST3

Keybase proof

I hereby claim:

  • I am brendanthompson on github.
  • I am bthompson (https://keybase.io/bthompson) on keybase.
  • I have a public key whose fingerprint is B660 1042 6D52 0F61 ED34 742E 8D37 2514 5E87 1BD7

To claim this, I am signing this object:

#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
@BrendanThompson
BrendanThompson / checkOS
Created April 19, 2014 02:36
Checks package managers to determine which to use.
#!/usr/bin/env bash
OS=""
if [[ -n $(command -v brew) ]]; then
OS="OSX"
elif [[ -n $(command -v yum) ]]; then
OS="RH"
elif [[ -n $(command -v apt-get) ]]; then
OS="DEB"
@BrendanThompson
BrendanThompson / scriptcs
Last active August 29, 2015 13:59
Bash script for executing scriptcs
#!/usr/bin/env bash
MONO=$(command -v mono)
SCRIPTCS="/usr/local/etc/scriptcs/scriptcs.exe" ## Later will get it to pull and extract here
COMMAND=""
case $1 in
"-repl" )
COMMAND="$MONO $SCRIPTCS -modules mono -repl"
$COMMAND
@BrendanThompson
BrendanThompson / getFileName.sh
Last active August 29, 2015 13:58
This will get the file name when a full path is given.
i=0; cut -d '/' -f $(( $i + $(grep -o '/' <<< $FILE | grep -c .) )) <<< $FILE
@BrendanThompson
BrendanThompson / dateValidation.js
Last active September 10, 2017 13:04
Validation to confirm that the inputted date is greater than or equal to today's date
// This validation is used inside an ASP.net WebForms application.
function dateValidation(source, args) {
var today = new Date();
var parsedInputDate = new Date(args.Value.replace(/(\d{2})\/(\d{2})\/(\d{4})/, '$3-$2-$1')); // This assumes the splitting of date parts on the input is a "/"
function stripTime(inputDate) {
var strippedInputDate = new Date(inputDate.getFullYear(), inputDate.getMonth() + 1, inputDate.getDate()); // Require to add one to the month as in JavaScript January is month 0
return strippedInputDate;
}