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
git rebase --root -i | |
git push <remote> <branch> --force | |
# or force pushing more safely | |
git push <remote> <branch> --force-with-lease |
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 org.osgi.framework.Bundle; | |
import org.osgi.framework.BundleContext; | |
public class BundleHelper { | |
private BundleHelper() { | |
} | |
public static Bundle findBundleBySymbolicName(BundleContext bundleContext, String symbolicName) { | |
Bundle result = null; |
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
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP" | |
-- OR -- | |
wmic product where "Name like 'Microsoft .Net%'" get Name, Version | |
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
public static void Sort<T,U>(this List<T> list, Func<T, U> expr) | |
where U : IComparable<U> | |
{ | |
list.Sort((x, y) => expr(x).CompareTo(expr(y))); | |
} |
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 org.osgi.framework.Bundle; | |
import org.osgi.framework.BundleContext; | |
import org.osgi.framework.wiring.BundleWiring; | |
public class BundleUtils { | |
public static Bundle findBundleBySymbolicName(BundleContext bc, String symbolicName) { | |
Bundle result = null; | |
for (Bundle candidate : bc.getBundles()) { | |
if (candidate.getSymbolicName().equals(symbolicName)) { | |
if (isBetterCandidate(result, candidate)) { |
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
gfind ./ -type f -name *.java -exec sed -i "s/\t/ /g" {} \; |
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
@Grab(group='org.apache.geronimo.specs', module='geronimo-jms_1.1_spec', version='1.1.1') | |
import javax.jms.* | |
@Grab(group='org.fusesource.stompjms', module='stompjms-client', version='1.19') | |
import org.fusesource.stomp.jms.* | |
def factory = new StompJmsConnectionFactory() | |
factory.with { | |
topicPrefix = "" | |
queuePrefix = "" |
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-Service ora* | Where-Object {$_.status -eq "running"} | Stop-Service |
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 jenkins.model.* | |
def jobName = '(...)' | |
def job = Jenkins.instance.getItem(jobName) | |
def builds = job.getBuilds() | |
builds.each { it.delete() } |
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
public class PortFinder { | |
private static final int MIN_PORT_NUMBER = 1024; | |
private static final int MAX_PORT_NUMBER = 49151; | |
/** | |
* Finds a free port between | |
* | |
* @return a free port number |