This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Python script to find the largest files in a git repository. | |
# The general method is based on the script in this blog post: | |
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# | |
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess as sub | |
def vs_env_dict(vsver): | |
cmd = r'cmd /s /c ""%VS{0}COMNTOOLS%vsvars32.bat" & set"'.format(vsver) | |
output = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.STDOUT, stdin=sub.PIPE).communicate()[0].split(os.linesep) | |
return dict((e[0].upper(), e[1]) for e in [p.rstrip().split("=", 1) for p in output] if len(e) == 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Demonstrate high quality docstrings. | |
Module-level docstrings appear as the first "statement" in a module. Remember, | |
that while strings are regular Python statements, comments are not, so an | |
inline comment may precede the module-level docstring. | |
After importing a module, you can access this special string object through the | |
``__doc__`` attribute; yes, it's actually available as a runtime attribute, | |
despite not being given an explicit name! The ``__doc__`` attribute is also |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.cloudbees.hudson.plugins.folder.Folder | |
import hudson.FilePath | |
import jenkins.model.Jenkins | |
def boolean isFolder(String name) { | |
def item = Jenkins.instance.getItemByFullName(name) | |
return item instanceof Folder | |
} | |
def deleteUnusedWorkspace(FilePath root, String path) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _WIN32_WINNT 0x0400 | |
#include <stdio.h> | |
#include <windows.h> | |
#include <Wincrypt.h> | |
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING) | |
void MyHandleError(char *s); | |
void main(void) | |
{ | |
//------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure the settings to use to setup this Jenkins Slave | |
$IPAddress = '192.168.1.96' | |
$SubnetPrefixLength = 24 | |
$DNSServers = @('192.168.1.1') | |
$DefaultGateway = '192.168.1.1' | |
$JenkinsSlaveFolder = 'c:\jenkins' | |
# Install .NET Framework 3.5 | |
Install-WindowsFeature -Name NET-Framework-Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do. | |
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk: | |
git svn clone -T trunk http://example.com/PROJECT | |
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T: | |
git svn clone -T branches/somefeature http://example.com/PROJECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ "key": "ctrl+shift+o", "command": "workbench.action.files.openFolder" }, | |
{ "key": "ctrl+k ctrl+d", "command": "editor.action.formatDocument" }, | |
{ "key": "escape", "command": "closeFindWidget", | |
"when": "findWidgetFocus && findWidgetVisible" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the UnitTest Binaries | |
$files = Get-ChildItem $TestAssembliesDir\*est*.dll | |
# VSTest.console.exe path | |
$VSTestPath = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' | |
# MSTest path | |
$MSTestpath = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe" | |
# Loop through the test assemblies and add them to the VSTestFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Chocolatey profile | |
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
if (Test-Path($ChocolateyProfile)) { | |
Import-Module "$ChocolateyProfile" | |
} | |
#try { $null = gcm pshazz -ea stop; pshazz init } catch { } | |
$env:PYTHONIOENCODING="utf-8" | |
# TLS 1.2 support | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor |
OlderNewer