Skip to content

Instantly share code, notes, and snippets.

View joemoe's full-sized avatar
💉
gimme that juice

Joe Moser joemoe

💉
gimme that juice
View GitHub Profile
// crate some random korpi
for(let i = 1; i <= 10; i++) {
for(let j = 1; j <= 10; j++) {
this.createKorpus(i * 34, 100 + j * 34, 0x333333, i / 10, j / 10);
}
}
@joemoe
joemoe / crate-fractal.js
Created November 28, 2019 08:00
A script that generates a fractal out of the Crate.io logo using p5js.
function setup() {
createCanvas(windowWidth, windowHeight);
recurse((windowWidth - windowHeight) / 2 + 10, 10, Math.min(windowWidth, windowHeight) - 20, false, 200, 7);
}
function draw() {
}
function recurse(x, y, squareSize, rotate, trans, weight) {

Keybase proof

I hereby claim:

  • I am joemoe on github.
  • I am joemoe (https://keybase.io/joemoe) on keybase.
  • I have a public key ASA4P7TkrVZrsfIL-OebY2o_m8N_pUIF4BlJ-fO6m2lHMQo

To claim this, I am signing this object:

@joemoe
joemoe / cratedb-mqtt-mosquitto.md
Created September 29, 2017 15:14
Ingesting MQTT into CrateDB via Mosquitto sub/pub

Requirements

  • Have mosquitto_pub installed.
  • Have mosquitto_sub installed.
  • Have cr8 installed.
  • Have crash installed.

Start CrateDB server with MQTT enabled

@joemoe
joemoe / saveBlobs.sh
Last active July 6, 2017 08:50
Saving Blobs in CrateDB 2.0.x
# This gist provides two upgrade paths from CrateDB 2.0.0, 2.0.1, 2.0.2 and 2.0.3 to 2.0.4.
# If you are on CrateDB < 2.0, don't upgrade until 2.0.4 is released.
# In any case make sure you backup your data folder.
# This issue affects CrateDB >= 2.0.0 and < 2.0.4.
# Blobs are deleted on shutdown. So your cluster will be affected:
# * When you have no replicas set on a blob table and gracefully shut down a single node.
# * When you have replicas enabled on a blob table and shut down the whole cluster.
$('#board-body .data-release-content.board-subtasks-activities').each(function(index, el) {
var complexityCollector = {it: 0, ct: 0, dr: 0, r: 0};
var businessCollector = {it: 0, ct: 0, dr: 0, r: 0};
var badCards = 0;
var $el = $(el)
$el.find('.board-card-title-text').each(function(index, subel) {
var $subel = $(subel);
DROP TABLE IF EXISTS geo_shapes_altitude;
CREATE TABLE IF NOT EXISTS geo_shapes_altitude(name string, shape geo_shape);
--2D
INSERT INTO geo_shapes_altitude VALUES('point', { type = 'Point', coordinates = [100.0, 0.0] });
INSERT INTO geo_shapes_altitude VALUES('linestring', { type = 'LineString', coordinates = [ [100.0, 0.0], [101.0, 1.0] ] });
INSERT INTO geo_shapes_altitude VALUES('polygon', { type = 'Polygon', coordinates = [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] });
INSERT INTO geo_shapes_altitude VALUES('polygon with holes', { type = 'Polygon', coordinates = [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
package at.joemoe.atlas.demo;
import com.atlassian.confluence.macro.Macro;
import com.atlassian.confluence.setup.settings.SettingsManager;
import java.util.*;
public class MyMacro implements Macro {
private SettingsManager settingsManager;
@joemoe
joemoe / pom.xml
Created September 11, 2015 08:51
Add Atlassian Repository to pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
...
<repositories>
<repository>
<id>atlassian-public</id>
<url>https://m2proxy.atlassian.com/repository/public</url>
<snapshots>
<enabled>true</enabled>