Skip to content

Instantly share code, notes, and snippets.

@lipkau
lipkau / Get-Uptime.ps1
Last active September 5, 2015 17:43
Get Computer's uptime
function Get-Uptime
{
<#
.SYNOPSIS
Get Computer's uptime
.DESCRIPTION
Returns the total time since the last reboot
.NOTES
@lipkau
lipkau / $(...) Complex Subexpression.sublime-snippet
Created September 8, 2015 06:23
[PowerShell] Snippet: My Sublime Text 3 PowerShell Snippets
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[\$($1)]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>sub</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
@lipkau
lipkau / hashtable_transformation.ps1
Last active October 19, 2015 09:13
[BUG] Transform HashTable to Custom Object
Add-Type -TypeDefinition @"
using System;
namespace foo
{
public struct bar {
public Int64 id;
}
}
"@
[CmdletBinding()]
[OutputType([System.Management.Automation.PSModuleInfo])]
param(
# The name of the module to install from GitHub.
[Parameter(Position=0, Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$ModuleName,
# The scope from which the module should be discoverable.
@lipkau
lipkau / Format-Wide.ps1
Last active February 24, 2016 10:13
[PowerShell] ProxyFunction: Pivot Format-Wide output
function Format-Wide {
[CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=113304')]
param(
[Parameter(
Position=0
)]
[System.Object]${Property},
[switch]${AutoSize},
@lipkau
lipkau / New-Folder.ps1
Last active October 16, 2017 15:04
Create new folder and naviagte into it #powershell #helperFunction #workflow
function New-Folder
{
<#
.Synopsis
Create a new folder and navigate into it
.Description
Create a new folder and navigate into it
.Notes
@lipkau
lipkau / Start-WebServer.ps1
Last active March 9, 2017 15:33
Create local http server using PHP.exe #powershell #helperFunction #workflow
<#PSScriptInfo
.VERSION 1.0
.GUID 9c74d64a-774d-4f5a-a8c4-485fd079e7bd
.AUTHOR
Oliver Lipkau <oliver@lipkau.net>
.COPYRIGHT
Oliver Lipkau
@lipkau
lipkau / Get-ConfluenceVersion.ps1
Last active March 4, 2017 23:05
Fetch version of the confluence Server
function Get-ConfluenceVersion {
[CmdletBinding()]
param (
# Server
[Parameter(Mandatory = $true)]
[string] $ServerUrl
)
begin {
$response = Invoke-RESTMethod -Uri $ServerUrl
@lipkau
lipkau / AtlassianTuner.user.js
Last active July 9, 2020 03:05
UserScript for Atlassian's Jira and Confluence
// ==UserScript==
// @name AtlassianTuner
// @description Custom javascript to inject onto Atlassian's Jira and Confluence to make experience better (at least for me)
// @namespace https://gist.github.com/lipkau/481342249739847f2d7f8d3099783ce4
// @author Oliver Lipkau
// @version 0.10.1
// @include https://*.bsh-sdd.com*
// @require https://code.jquery.com/jquery-2.2.4.min.js#sha256=BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=
// @require https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js#sha256=WofcoLT8gToeaSmVRe28qpnlFxdBJH1n4K6Bk3YowvU=
// @run-at document-start
@lipkau
lipkau / html.json
Created May 19, 2017 15:21
Insert Snippet around selection with keybinding #vscode #sample
{
"make_strong": {
"prefix": "strong",
"body": [
"<strong>$TM_SELECTED_TEXT${1}</strong>${0}"
],
"description": "Encloses selected text in <strong></strong> tags"
},
"make_italic": {
"prefix": "italic",