Skip to content

Instantly share code, notes, and snippets.

@ctran
ctran / keybase.md
Created October 10, 2017 21:46
Keybase proof

Keybase proof

I hereby claim:

  • I am ctran on github.
  • I am ctran (https://keybase.io/ctran) on keybase.
  • I have a public key ASBx82K3-rmNeCDB0Dr2lIBx4WUJ0e9hBex-vKRzKeS6ZQo

To claim this, I am signing this object:

node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.
@ctran
ctran / build.gradle
Created July 8, 2016 23:18 — forked from fikovnik/build.gradle
Building maven plugins by gradle
configurations {
mavenEmbedder
}
dependencies {
compile "org.apache.maven:maven-core:$mavenVersion"
compile "org.apache.maven:maven-plugin-api:$mavenVersion"
compile 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4'
mavenEmbedder "org.apache.maven:maven-embedder:$mavenVersion"
@ctran
ctran / app.ts
Created May 14, 2016 06:50
Ionic2 - Global Var
@App({
providers: [GlobalService], // constructed once
config: {}
})
class MyApp {
}
@ctran
ctran / Open in Sublime.scpt
Created December 21, 2015 03:46
Open selected folder in Sublime Text (Finder)
on run
tell application "Finder"
if selection is {} then
set finderSelection to folder of the front window as string
else
set finderSelection to selection as alias list
end if
end tell
subl(finderSelection)
@ctran
ctran / check-slave-jar-version.groovy
Last active May 9, 2023 12:21
Check slave.jar versions of slaves against expected version on Jenkins master
import jenkins.model.*
import hudson.remoting.Launcher
import hudson.slaves.SlaveComputer
def expectedVersion = Launcher.VERSION
for (computer in Jenkins.instance.getComputers()) {
if (! (computer instanceof SlaveComputer)) continue
if (!computer.getChannel()) continue
def version = computer.getSlaveVersion()
@ctran
ctran / memhog.c
Created September 18, 2015 03:52
memhog.c
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define CHUNK (128 * 1024)
void usage(const char *prog, FILE *out)
{
fprintf(out, "usage: %s allocsize\n", prog);
fprintf(out, " allocsize is kbytes, or number[KMGP] (P = pages)\n");
@ctran
ctran / keybase.md
Last active August 29, 2015 14:18
keybase.md

Keybase proof

I hereby claim:

  • I am ctran on github.
  • I am ctran (https://keybase.io/ctran) on keybase.
  • I have a public key whose fingerprint is B4D2 611F 2E8A CE1F F0E6 F498 5B6A 73FB FEB3 75DA

To claim this, I am signing this object:

@ctran
ctran / Hanoi.elm
Last active August 29, 2015 14:13
Tower of Hanoi
import Text (..)
type alias Peg = String
type alias Move = (Peg, Peg)
hanoi: Int -> Peg -> Peg -> Peg -> List Move
hanoi n a b c =
if n == 0 then []
else
let
import Graphics.Element (..)
import Html (..)
import Html.Attributes (..)
import Html.Events (..)
import Html.Lazy (lazy, lazy2)
import Json.Decode as Json
import List
import Maybe
import Signal
import String