Skip to content

Instantly share code, notes, and snippets.

View tekmaven's full-sized avatar

Ryan Hoffman tekmaven

View GitHub Profile
@tekmaven
tekmaven / gist:5842521
Created June 22, 2013 20:44
This is a mirror of http://www.pastie.org/1977343. It appears this site is down, and I retrieved this from the Google Cache. It contains a source code sample from a Stack Overflow answer (http://stackoverflow.com/questions/12081251/mongodb-as-a-queue-capped-collection-tailable-cursor). This is the only source code example I could find online wit…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
@tekmaven
tekmaven / seamless-show-all-tooltips.js
Last active August 29, 2015 13:58
Show all tooltips on Seamless menus
var tooltips = document.querySelectorAll("[id$='Tooltip']");
for(var i = 0; i < tooltips.length; i++) {
tooltips[i].style.position = "inherit";
tooltips[i].style.display = "inherit";
}
@tekmaven
tekmaven / Install-MongoDb-On-AppVeyor.ps1
Last active April 30, 2016 18:55
Install MongoDB on AppVeyor
#Make sure 7za is installed
choco install 7zip.commandline
# Create mongodb and data directory
md $env:temp\mongo\data
# Go to mongodb dir
Push-Location $env:temp\mongo
# Download zipped mongodb binaries to mongodbdir
@tekmaven
tekmaven / Octopus.AzureContext.ps1
Created June 17, 2015 02:43
Octopus Deploy 3.0: Use system Azure Powershell module if it exists
## Octopus Azure Context script, version 1.0
## --------------------------------------------------------------------------------------
##
## This script is used to load the Azure Powershell module and select the Azure subscription
##
## The sript is passed the following parameters.
##
## $OctopusAzureModulePath = "....\Calamari\AzurePowershell\Azure.psd1"
## $OctopusAzureCertificateFileName = "...."
## $OctopusAzureCertificatePassword = "...."
@tekmaven
tekmaven / Azure-To-RoyalTS.ps1
Created July 11, 2015 18:57
RoyalTS Document Builder for Azure Virtual Machines
#Auth to your azure account
Add-AzureAccount
Import-Module 'C:\Program Files (x86)\code4ward.net\Royal TS V3\RoyalDocument.PowerShell.dll' -Force
function CreateRoyalFolderHierarchy()
{
param(
[string]$folderStructure,
[string]$splitter,
@tekmaven
tekmaven / App.config
Created July 26, 2016 16:28 — forked from dieseltravis/CryptoHelper.cs
sample app that uses PGP Encryption using Bouncy Castle's C# API
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<add key="Password" value="ThisIsNotARealPassword" />
<add key="PublicKey" value="PgpPublicKey.asc" />
<add key="PrivateKeyOnly" value="PgpPrivateKeyOnly.asc" />
</configuration>
@tekmaven
tekmaven / profile.ps1
Created February 17, 2017 18:30
Launch Visual Studio solution in current directory
function openFirstSlnFile() {
& ".\\$(dir *.sln | select -first 1 -expand Name)"
}
Set-Item -Path alias:vs -value openFirstSlnFile
@tekmaven
tekmaven / runes.sh
Created September 25, 2017 17:47
Run ElasticSearch on Docker
docker run -p 9200:9200 -e "xpack.security.enabled=false" -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" --name elasticsearch --restart always docker.elastic.co/elasticsearch/elasticsearch:5.4.2
@tekmaven
tekmaven / prepare-commit-msg.sh
Last active June 5, 2019 12:31 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a JIRA ID, from branch name. Ignores branch name if JIRA ID is not found in branch name.
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | grep -oE "[A-Z]+-[0-9]+")
if [ -n "$BRANCH_NAME" ]; then