Skip to content

Instantly share code, notes, and snippets.

@rohancme
rohancme / Jenkinsfile-windows.groovy
Last active November 3, 2017 02:06
A simple Windows Jenkinsfile for the Kubernetes plugin
podTemplate(label: 'windows-vs2017',
containers: [
containerTemplate(name: 'jnlp', image: '{{REPLACE-WITH-YOUR-CUSTOM-IMAGE}}',
envVars:[
containerEnvVar(key: 'HOME', value:'C:\\users\\containeradministrator'),
containerEnvVar(key: 'JENKINS_HOME', value: 'G:\\')
],
workingDir:'C:\\Jenkins\\')
],
nodeSelector: 'beta.kubernetes.io/os=windows') {
@rohancme
rohancme / Jenkinsfile-ubuntu.groovy
Last active November 3, 2017 02:06
Jenkinsfile for a Linux build with the K8S plugin
podTemplate(label: 'my-build-pod', containers: [
// This is the official jnlp base image with added support for ssh access to git repos
containerTemplate(name: 'jnlp', image: 'larribas/jenkins-jnlp-slave-with-ssh:1.0.0', args: '${computer.jnlpmac} ${computer.name}'),
// This image gives us a container with kubectl installed so we can deploy the image we build
containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl', ttyEnabled: true, command: 'cat'),
// A docker container to build our image
containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true)]) {
node ('my-build-pod') {
// Store ssh credentials in Jenkins, replace GITHUB_URL with your Github Repo
git branch: "${env.BRANCH_NAME}", credentialsId: "{{JENKINS_CREDENTIALS}}", url: '{{GITHUB_URL}}'
@rohancme
rohancme / jenkins-ubuntu-agent-Dockerfile
Last active November 3, 2017 02:07
Jenkins Ubuntu slave
FROM jenkinsci/jnlp-slave
ENV JENKINS_AGENT_NAME ubuntu-agent
## Location to download slave.jar from
ARG JENKINS_URL
ARG JENKINS_SECRET
@rohancme
rohancme / jenkins-master-deployment.yaml
Created July 15, 2017 01:37
Jenkins master Kubernetes deployment file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins-master
namespace: ci
spec:
template:
metadata:
labels:
name: jenkins-master
@N-Dekker
N-Dekker / CompareOldAndRangeBasedConstantBoundary.cxx
Last active November 7, 2018 17:19
Compares performance of "old-school" and new range-based neighborhood iteration using http://review.source.kitware.com/#/c/23795/7
/*
Compares performance of "old-school" neighborhood iteration, using
itk::ConstantBoundaryCondition, and range-based neighborhood iteration,
using the patch "WIP: Added policy for constant NeighborhoodRange values
outside image", http://review.source.kitware.com/#/c/23795/7.
Niels Dekker, LKEB, Leiden University Medical Center, 2018
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakirkham
jakirkham / AOLLSM_ITK.ipynb
Last active July 13, 2019 21:18
Applying Richardson-Lucy Deconvolution from ITK on AOLLSM using Dask
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rabernat
rabernat / zarr_over_http.ipynb
Last active July 16, 2019 18:12
Zarr over http
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FROM microsoft/windowsservercore
# Specify a public IP here so the build machine can download slave.jar
ARG BASE_URL
# Specify the internal Kubernetes service IP Address here
ARG JENKINS_JNLP_URL
ARG JENKINS_SECRET
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
@takluyver
takluyver / README.md
Created September 6, 2014 21:44
Flatten notebooks for git diff

Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv nbflatten.py

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.