Skip to content

Instantly share code, notes, and snippets.

View michaelvdnest's full-sized avatar

Michael van der Nest michaelvdnest

View GitHub Profile
@michaelvdnest
michaelvdnest / OLEDBData.psm1
Created May 22, 2015 07:27
Some functions to run queries against OLEDB data sources
function Get-OLEDBData{
<#
.SYNOPSIS
This function is used to retrieve data via an OLEDB data connection.
.DESCRIPTION
Retrieves data via an OLEDB data connection.
.INPUTS
System.String,System.String,System.String
@michaelvdnest
michaelvdnest / Get-IniContent.ps1
Created May 22, 2015 07:29
Gets the content of an INI file.
Function Get-IniContent
{
<#
.Synopsis
Gets the content of an INI file
.Description
Gets the content of an INI file and returns it as a hashtable
.Notes
@michaelvdnest
michaelvdnest / Get-Lines.ps1
Created May 22, 2015 07:30
Get lines from a file between two positions in a file.
Function Get-Lines {
<#
.SYNOPSIS
Get lines from a file.
.DESCRIPTION
Get lines from a file between two positions in a file.
You can return lines between a from line number until a to line number or
between regular expression patterns.
@michaelvdnest
michaelvdnest / Get-Windows.ps1
Last active August 29, 2015 14:21
Gets the windows together with process id that are open on the local computer
. '\Logging_Functions.ps1'
Function Get-Windows{
[CmdletBinding()]
param (
[Parameter(Mandatory=$false)][string]$LogFile
)
Write-Verbose 'Performing operation "Get-Windows"'
@michaelvdnest
michaelvdnest / Export-Screenshot.ps1
Created May 22, 2015 09:11
Saves a screenshot of the current desktop to a file.
<#
.SYNOPSIS
Saves a screenshot of the current desktop to a file.
.DESCRIPTION
Saves a screenshot of the current desktop to a file. Supported extensions for the
image file are BMP, GIF, EXIF, JPG, PNG and TIFF.
.PARAMETER Path
Mandatory. Specifies the path to the file that will be created.
@michaelvdnest
michaelvdnest / Format-NumAsWord.ps1
Created May 22, 2015 10:17
Format a number as a word
function Format-NumAsWord
{
[CmdletBinding()]
param (
[parameter(Position=0)]
[double]$n = 0,
[parameter(Position=1)]
[boolean]$Caps = $False
@michaelvdnest
michaelvdnest / optparse_demo.rb
Last active November 15, 2023 21:37
A sample of Ruby optparse usage
require 'optparse'
options = {}
class Parser
def self.parse(args)
options = {}
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: demo.rb [options] ARG...'
opts.separator 'A demo of optparse.'

I'm t9md

t9md__t9md_.png Presentation1.png

  • My editor history: Vim > Emacs > Vim > Atom
@michaelvdnest
michaelvdnest / pr.md
Created July 12, 2018 09:42 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@michaelvdnest
michaelvdnest / profiles.clj
Created May 7, 2019 07:36
My Clojure profiles file.
;; Calva depends on nREPL and Cider nREPL middleware
;; Clojure
{:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]
:dependencies [[nrepl "0.6.0"]]}}
;; ClojureScript
{:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]
:dependencies [[nrepl "0.6.0"]
[cider/piggieback "0.4.0"]
[figwheel-sidecar "0.5.18"]]