yUML is a simple tool for embedding UML diagrams in wikis and blogs without needing any UML or diagramming tools.
Here's an idea of how it could be used in your repository readme.markdown or wiki.
View the RAW source to see how images are made.
yUML is a simple tool for embedding UML diagrams in wikis and blogs without needing any UML or diagramming tools.
Here's an idea of how it could be used in your repository readme.markdown or wiki.
View the RAW source to see how images are made.
enum PatchLevel { | |
MAJOR, MINOR, PATCH | |
} | |
class SemVer implements Serializable { | |
private int major, minor, patch | |
SemVer(String version) { | |
def versionParts = version.tokenize('.') |
//Problem: | |
//languages like tcl can simply switch between the String representation of a map or list and the | |
//object itself. In Groovy, this could theoretically work, but it doesn't: | |
def list1 = [1,2,3] | |
def list2 = ["1, 2, 3"] | |
assert list1 != list2 | |
assert list1.toString() == list2.toString() | |
assert Eval.me(list1.toString()) instanceof List | |
assert Eval.me(list2.toString()) instanceof List | |
assert Eval.me(list1.toString()) == Eval.me(list2.toString()) |
This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.
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 |
# 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 |
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) { |
# -*- 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 |
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) |
#!/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. |