Skip to content

Instantly share code, notes, and snippets.

@jglick
jglick / git-grep-dired.el
Created July 24, 2012 20:46
M-x git-grep-dired: Emacs command to search for text patterns in a Git repo à la find-grep-dired
(defun git-grep-dired (repo wildcards regexp)
"Find Git-controlled files in DIR with a name like WILDCARDS containing a regexp REGEXP and start Dired on output."
(interactive "DGit-grep (directory): \nsGit-grep (filename wildcard(s), e.g. *.xml): \nsGit-grep (grep regexp): ")
(setq repo (file-name-as-directory (expand-file-name repo)))
(switch-to-buffer (concat "*Git Grep " repo "*"))
(fundamental-mode)
(setq buffer-read-only nil)
(erase-buffer)
(setq default-directory repo)
(let ((cmd (format "git --git-dir %s/.git ls-files -z%s | xargs -0 grep -lZ -- %s | xargs -0 ls -l"
@jglick
jglick / gist:4154417
Created November 27, 2012 14:13
Wrapper script to run a command inside XVnc
#!/bin/sh
display=:93
vncserver -kill $display
vncserver $display -desktop "$1 test display" -geometry 1375x975 -depth 16 || exit
trap "vncserver -kill $display" EXIT
vncviewer -passwd ~/.vnc/passwd $display &
export DISPLAY=$display
twm &
"$@"
diff --git a/features/configure_slaves.feature b/features/configure_slaves.feature
index 80603e6..3b199e4 100644
--- a/features/configure_slaves.feature
+++ b/features/configure_slaves.feature
@@ -6,9 +6,13 @@ Feature: configure slaves
Scenario: Tie a job to a specified label
Given a job
And a dumb slave
+ Then Wait for keypress
When I add the label "test" to the slave
-------------------------------------------------------------------------------
Test set: hudson.model.UpdateSiteTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 14.407 sec <<< FAILURE!
updateDirectlyWithJson(hudson.model.UpdateSiteTest) Time elapsed: 9.668 sec <<< FAILURE!
java.lang.AssertionError: expected:<OK: <div/>> but was:<ERROR: Digest mismatch: WLv8irZifjnDeekE5oOE3i+Drgk= vs 2MRlOHwN1GsWuoAfIxfeyFM9og0= in update site &#039;default&#039;>
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.failNotEquals(Assert.java:647)
at org.junit.Assert.assertEquals(Assert.java:128)
at org.junit.Assert.assertEquals(Assert.java:147)
@jglick
jglick / gist:5967997
Created July 10, 2013 16:52
Errors in Zendesk preventing ticket history from being displayed. (Chrome 28)
Unexpected token , SyntaxError: Unexpected token ,
at Object.Function (<anonymous>)
at Object.n.createFunctionContext (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:13:11130)
at Object.n.compile (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:13:9696)
at i (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:13:16998)
at https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:13:17093
at Ember.View.Ember.Object.extend.render (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:16:2554)
at Ember.View.Ember.Object.extend.renderToBuffer (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:16:7339)
at Ember.View.states.inBuffer.appendChild (https://assets.zendesk.com/agent/assets/vendor-9f0fea21af96e71c1c0900be056ff9b1.js:16:13171)
at Ember.View.Ember.Object.extend.invokeForState (https:/
@jglick
jglick / gist:9490301
Created March 11, 2014 17:07
maven-hpi-plugin unbuildable
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Jenkins Plugin
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting /space/src/jenkinsci/maven-hpi-plugin/target
[INFO] [enforcer:enforce {execution: enforce-maven}]
[INFO] [enforcer:display-info {execution: display-info}]
[INFO] Maven Version: 2.2.1
java.lang.NullPointerException
com.cloudbees.jenkins.plugins.github_pull.CommitSpoolRepositoryMissingAction.hasError(CommitSpoolRepositoryMissingAction.java:20)
com.cloudbees.jenkins.plugins.github_pull.PullRequestBuildTrigger.getProjectActions(PullRequestBuildTrigger.java:83)
hudson.model.Project.createTransientActions(Project.java:222)
hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:746)
hudson.model.AbstractProject.save(AbstractProject.java:284)
hudson.model.AbstractItem.setDisplayName(AbstractItem.java:156)
hudson.model.Job.doConfigSubmit(Job.java:1123)
hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:787)
@jglick
jglick / gist:6257bcc2d5c7c53231c0
Created May 15, 2014 16:35
Sample acceptance-test-harness failures
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 227.711 sec <<< FAILURE! - in plugins.AntPluginTest
locallyInstalledAnt(plugins.AntPluginTest) Time elapsed: 78.527 sec <<< ERROR!
org.openqa.selenium.NoSuchElementException: Unable to locate By.selector: h2 + pre in http://127.0.0.1:61541/script
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.40.0', revision: '4c5c0568b004f67810ee41c459549aa4b09c651e', time: '2014-02-19 11:13:01'
System info: host: 'jglick-t520', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.7.0_55'
Driver info: driver.version: unknown
at org.jenkinsci.test.acceptance.po.CapybaraPortingLayer.find(CapybaraPortingLayer.java:148)
at org.jenkinsci.test.acceptance.po.Node.runScript(Node.java:52)
at plugins.AntPluginTest.localAntVersion(AntPluginTest.java:137)
@jglick
jglick / gist:c1219471f0feabeed557
Created May 17, 2014 00:20
CpsStepContext.replay NPE
java.lang.NullPointerException
at org.jenkinsci.plugins.workflow.cps.CpsStepContext.replay(CpsStepContext.java:344)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:100)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at Script1.run(Script1.groovy:1)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:67)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
@jglick
jglick / ReloadDemo.java
Created September 30, 2014 20:31
Try running in JDK 8u20 under debugger, then uncomment noted line and JPDA hot-reload. Does not work.
import java.util.Date;
import java.util.function.Consumer;
public class ReloadDemo {
public static void main(String[] args) throws InterruptedException {
while (true) {
run((String x) -> System.out.println(x + " first"));
run((String x) -> System.out.println(x + " second"));
//run((String x) -> System.out.println(x + " third"));
Thread.sleep(1000);
}