Skip to content

Instantly share code, notes, and snippets.

@seeliang
seeliang / lint-only-changed-files.MD
Last active June 10, 2024 05:37
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@pantsel
pantsel / docker-compose.yml
Last active May 13, 2024 14:29
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@drmohundro
drmohundro / Get-FrameworkVersions.ps1
Last active May 12, 2022 13:28
PowerShell script to return all installed .NET Framework versions.
<#
.Synopsis
Returns the install .NET Framework versions.
.Description
The script looks through the registry using the notes from the below
MSDN links to determine which versions of .NET are installed.
@amitapl
amitapl / webjobs.props
Last active June 16, 2016 20:23
webjobs.props
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
$(CopyAllFilesToSingleFolderForPackageDependsOn);
AddWebJobFilesToPublish;
</CopyAllFilesToSingleFolderForPackageDependsOn>
<_DestinationType>AzureWebSite</_DestinationType>
</PropertyGroup>
</Project>
@RISCfuture
RISCfuture / mdtable.rb
Created May 29, 2014 01:51
mdtable: Clean up Markdown tables in code comments and Markdown files
#!/usr/bin/env ruby
require 'find'
def parse_cells(row)
row.split('|').map(&:strip)[1..-1]
end
def header?(cells)
cells.all? { |cell| cell =~ /^:?\-+:?$/ }
@jstangroome
jstangroome / Convert-TfsBuildDefinitionToXml.ps1
Created September 29, 2013 00:01
Serialize a TFS 2012 Build Definition as XML to be version controlled
[CmdletBinding()]
param (
$CollectionUri,
$ProjectName
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName 'Microsoft.TeamFoundation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# This script allows Powershell Session Users to access services remotely
# Get Powershell Session Users SID
$objUser = New-Object System.Security.Principal.NTAccount("Powershell Session Users")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
# Get Current ACL for scmanager
$strOldACL = sc.exe sdshow scmanager | Out-String
# Find the ACL for interactive users
@return1
return1 / trim_enabler.txt
Last active May 26, 2024 11:01
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
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:

@bzerangue
bzerangue / mac-trim-support-non-apple-ssd.markdown
Created June 25, 2012 02:39
Enabling TRIM Support on Mac OS X with Non-Apple SSDs

How To: Enable TRIM with Non-Apple SSD

The guide breaks the process down into three steps, all performed via copying and pasting the code snippets through the terminal window. To launch a terminal window, open the Utilities folder inside the Applications folder and select terminal.

The first step makes a backup of the original IOAHCIBlockStorage file called IOAHCIBlockStorage.original. You will be prompted to enter in your system password when using the "sudo" command, since you are modifying system files. Copy and paste the code into the terminal window, a successful or uneventful response is a new blank terminal line.

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

Next the code patches the IOAHCIBlockStorage file, removing the requirements that the SSD be made by Apple. Copy and paste t