Skip to content

Instantly share code, notes, and snippets.

View ndeloof's full-sized avatar
💭
Preparing a new set of bugs

Nicolas De loof ndeloof

💭
Preparing a new set of bugs
View GitHub Profile
new File("plugins").eachLine { p ->
println "--- ${p} ---"
File d = new File("${p}-plugin")
if (!d.exists()) {
checkout(p)
}
injectRepo(d)
@ndeloof
ndeloof / gist:3760396
Created September 21, 2012 08:32
groovy issue
Exception in thread "main" java.lang.VerifyError: (class: groovy/runtime/metaclass/java/lang/StringMetaClass, method: super$2$invokeMethod signature: (Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;ZZ)Ljava/lang/Object;) Illegal use of nonvirtual function call
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createWithCustomLookup(MetaClassRegistry.java:127)
at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:122)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:165)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:195)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:231)
at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:747)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:10
@ndeloof
ndeloof / gist:8819372
Created February 5, 2014 08:33
play List JSON serialization
No Json deserializer found for type List[models.Subscription]. Try to implement an implicit Writes or Format for this type.
In /Volumes/HD/Users/nicolas/Boulot/cloudbees/je-sp/app/controllers/API.scala at line 25.
val subscriptions: List[Subscription] = ???
22 Ok(
23 Json.obj("account" -> account.getName,
24 "salesforce_id" -> account.getId,
25 "subscriptions" -> subscriptions,
26 "licenses" -> "TODO",
# OSX Mavericks, Docker 1.3.0
➜ ~ env |grep DOCKER
DOCKER_HOST=tcp://boot2docker:2376
DOCKER_TLS_VERIFY=1
FORWARD_DOCKER_PORTS=1
DOCKER_CERT_PATH=/Users/nicolas/.boot2docker/certs/boot2docker-vm
➜ ~ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0) libcurl/7.30.0 SecureTransport zlib/1.2.5
@ndeloof
ndeloof / gist:58e75b275fc72e0c7c23
Created January 23, 2015 09:54
Migrate Subversion crendentials
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.common.*;
import hudson.security.ACL
import hudson.scm.SubversionSCM
def jenkins = Jenkins.instance
jenkins.allItems.each { job ->
def scm = job.scm;
@ndeloof
ndeloof / gist:4ed2f5c8c02f19dc5b6e
Created February 26, 2015 08:21
to stream or not to stream
// What I used to do in Java 6/7
Collection<String> accountIds = new ArrayList<>();
for (GCAccount account : user.getGcAccounts()) {
for (Account sf : account.getSfAccounts()) {
accountIds.add(sf.getId());
}
}
// What I can do in Java 8
Collection<String> accountIds =
@ndeloof
ndeloof / gist:49e1cd84a887b9bb7e02
Created March 3, 2015 13:23
Lombok-enable Jenkins describable
@Describable("publicname")
public class Foo {
@DataBound private String bar;
}
FROM jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
modprobe zram
echo $((1024*1024*1024)) > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon -p 10 /dev/zram0
mount -t tmpfs -o size=512M tmpfs /var/lib/docker