View commit-msg.sh
#!/bin/sh
#
# A hook script that checks the length of the commit message.
#
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
DEFAULT="\033[0m"
View htmltomd.sh
#!/bin/bash
# htmltomd
# Downloads the HTML source from a list of URLs and converts it to Markdown.
# The source file must contain each URL to download from on a separate line.
# The actual conversion is done by the awesome API available at
# http://heckyesmarkdown.com
urlsFile=$1
outputDir=${2:-.} # Defaults to local dir
View cpustatus.sh
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
View Import-PSSnapin.ps1
function Import-PSSnapin {
<#
.Synopsis
Adds a Windows PowerShell snap-in with the specified name to the current session.
This cmdlet will not throw an exception if the specified snap-in is already present in the session.
.Description
Helper function to safely add a Windows PowerShell snap-in with the specified name to the current session.
.Parameter Name
The name of the snap-in to import.
#>
View Out-Diff.ps1
function Out-Diff {
<#
.Synopsis
Redirects a Universal DIFF encoded text from the pipeline to the host using colors to highlight the differences.
.Description
Helper function to highlight the differences in a Universal DIFF text using color coding.
.Parameter InputObject
The text to display as Universal DIFF.
#>
[CmdletBinding()]
View gist:1316023
[Test]
public void CS_compiler_should_allow_named_arguments_in_lambdas()
{
// Given
var mock = new Mock<IProceduralPizzaStore>();
// When
mock.Verify(
m => m.OrderPizza(
name: "Quattro Formaggi",
View FileHeader.snippet.xml
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>File Header</Title>
<Author>Enrico Campidoglio</Author>
<Shortcut>fh</Shortcut>
<Description>Adds a StyleCop compliant file header comment with company and copyright information.</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
View gist:1266880
//-----------------------------------------------------------------------
// <copyright file="«?FileBase»«?FileExtension»" company="«BlockAnchor»«Link(CompanyName)»«Caret»">
// Copyright (c) «Link(CompanyName)». All rights reserved.
// </copyright>
//-----------------------------------------------------------------------