Skip to content

Instantly share code, notes, and snippets.

Joa Ebert joa

Block or report user

Report or block joa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joa
joa / Dockerfile
Last active Oct 19, 2018
in-cluster dh param generation with kubernetes and rbac
View Dockerfile
FROM alpine:latest as builder
WORKDIR /usr/local/bin
RUN apk add --no-cache curl && \
export KUBECTL_VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) && \
curl -sLO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
chmod +x kubectl
FROM alpine:latest
View keybase.md

Keybase proof

I hereby claim:

  • I am joa on github.
  • I am joa (https://keybase.io/joa) on keybase.
  • I have a public key whose fingerprint is 5435 66F5 CEFD 8CD1 B9DF CE65 BD93 DD10 BF67 5F0F

To claim this, I am signing this object:

View glc_circles.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2);
glc.setFPS(60);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
View Foo.java
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.List;
public final class Foo {
public static void main(String[] args) {
final Constructor<?>[] ctors = A.class.getDeclaredConstructors();
for(Constructor<?> ctor : ctors) {
System.out.println(Arrays.toString(ctor.getParameterTypes()));
System.out.println(Arrays.toString(ctor.getGenericParameterTypes()));
View gist:2bae89a286ce2a54928b
// java source
public static void main(String[] args) {
for(int i = 0; i < 10; ++i) {
System.out.println(Color.normalize(255));
System.out.println(i);
}
}
// defrac js
main = function(args){
View double2int.js
// http://jsperf.com/double2int
function double2int=function(x){
if(isNaN(x))
return 0;
if(x==Infinity||x>0x7fffffff)
return 0x7fffffff;
if(x==-Infinity||x<-0x80000000)
return -0x80000000;
return x|0;
};
@joa
joa / HTMLOptionElement.js
Created Aug 1, 2014
Little JavaScript gem I found
View HTMLOptionElement.js
// what does the following code print?
//
// a) false, true
// b) true, true
// c) true, false
// d) none of the above
console.log(new Option() instanceof HTMLOptionElement)
console.log(new HTMLOptionElement() instanceof HTMLOptionElement)
View string-v8.js
// this will optimize-deoptimize leading to v8 giving
// up on the function
String.prototype.hashCode = function() {
var n = this.length;
var hash = 0;
if(n != 0) {
for(var i = 0; i < n; ++i)
hash = Math.imul(31, hash) + this.charCodeAt(i) | 0;
return hash;
View konklone.advanced.conf
server {
listen 80;
server_name konklone.com;
return 301 https://$host$request_uri;
}
# optional: the 'spdy' at the end of the listen command below turns on SPDY support.
server {
listen 443 ssl spdy;
@joa
joa / Main.java
Created Feb 7, 2014
Selecting JVM arguments for a simple Hello World program
View Main.java
class Main {
public static void main(final String[] args) {
System.out.println("Hello World!");
}
}
You can’t perform that action at this time.