on El Capitan, after installing the brew...
$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java
And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/
Check version:
on El Capitan, after installing the brew...
$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java
And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/
Check version:
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. |
#include <unistd.h> | |
int main() { | |
const char *b = "/bin/bash"; | |
setuid(0); | |
execl(b, b, 0); | |
} |
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
<template> | |
<!-- Will add/remove .small if the width is less / greater --> | |
<div class="post__item" v-responsive="{ small: el => el.width <= 500 }"> | |
<img class="post__image" :src="post.image" /> | |
<div class="post__text">{{post.text}}</div> | |
</div> | |
</template> | |
<script> | |
import { ResponsiveDirective } from "vue-responsive-components" |
require "kemal" | |
get "/stream" do |env| | |
env.response.print "START" | |
env.response.flush | |
sleep 3 | |
env.response.print "MIDDLE" | |
env.response.flush | |
sleep 5 | |
env.response.print "END" |
class Foo | |
attr_reader :bar | |
def initialize | |
@bar = 123 | |
ObjectSpace.define_finalizer( self, self.class.finalize(bar) ) | |
end | |
def self.finalize(bar) | |
proc { puts "DESTROY OBJECT #{bar}" } | |
end |
# Retry a command up to a specific numer of times until it exits successfully, | |
# with exponential back off. | |
# | |
# $ retry 5 echo Hello | |
# Hello | |
# | |
# $ retry 5 false | |
# Retry 1/5 exited 1, retrying in 1 seconds... | |
# Retry 2/5 exited 1, retrying in 2 seconds... | |
# Retry 3/5 exited 1, retrying in 4 seconds... |
def myMethod(a, b) { | |
println("a: " + a + " / b: " + b) | |
} | |
myMethod(1, 2) | |
println("---") | |
myMethod 1, 2 | |
println("---") |
def hash_to_param(myMap) { | |
myMap.collect { k, v -> [$class: 'StringParameterValue', name: k, value: v] } | |
} | |
def map = [ | |
Bob : 42, | |
Alice: 54, |