Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / app.ts
Created May 14, 2016 06:50
Ionic2 - Global Var
@App({
providers: [GlobalService], // constructed once
config: {}
})
class MyApp {
}
@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"
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 / 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:

@ctran
ctran / good-email-rules.md
Created December 4, 2017 18:52
Rules for good emails
  1. Keep the message as short as necessary but no shorter.
  2. Put the most important information at the top of the message.
  3. If it email is for an ask, call out from who you need the response and put it at the top of the message.
  4. If you need to send a long email with many details, put the most important information at the top (ie. what the reader needs to know) and then fill in the body with details he/she can choose to indulge.

Example:

Hey Jane, I need your input on how to prioritize my current work. Can you provide guidance on where I should focus? Bug XYZ was assigned to me and it's taking longer to complete because we have a dependency on Vendor ABC completing a change to their web service. This is impacting the commitment to my team on Feature 123 because we are near the end of our sprint.