Skip to content

Instantly share code, notes, and snippets.

@bhavinkamani
bhavinkamani / kafka_error.log
Created Sep 3, 2019
kafka installation error log with docker machine and parallels driver
View kafka_error.log
===> ENV Variables ...
ALLOW_UNSIGNED=false
COMPONENT=kafka
CONFLUENT_DEB_VERSION=1
CONFLUENT_MAJOR_VERSION=5
CONFLUENT_MINOR_VERSION=1
CONFLUENT_MVN_LABEL=
CONFLUENT_PATCH_VERSION=2
CONFLUENT_PLATFORM_LABEL=
CONFLUENT_VERSION=5.1.2
@bhavinkamani
bhavinkamani / index.html
Created Feb 15, 2016
http2 jspm config files
View index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="application/xhtml+xml">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=PT+Sans|PT+Sans+Caption' rel='stylesheet' type='text/css'>
<style type="text/css">
html, body {
margin: 0 auto;
@bhavinkamani
bhavinkamani / jspm.browser.js
Last active Feb 14, 2016
jspm_17 config files
View jspm.browser.js
SystemJS.config({
baseURL: "/",
production: true,
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*",
"vendor/": "src/vendor/",
"jspm_17/": "src/"
},
bundles: {
View snakes_ladders.sql
CREATE TABLE board(id serial primary key, moves int[]);
INSERT INTO board(moves) values('{0,0,0}');
WITH current AS (SELECT generate_series(1,3) p_no, unnest(moves) "pos" FROM board order by id desc LIMIT 3),
roll AS (SELECT generate_series(1,3) p_no, round(random()*2)+1 result),
move AS (SELECT coalesce('{"9":"2","3":"6"}'::json->>(c.pos+r.result)::text, (c.pos+r.result)::text)::int "new_pos", c.pos "old_pos"
FROM current c JOIN roll r ON c.p_no = r.p_no),
constrained_move AS (SELECT (CASE WHEN m.new_pos > 10 THEN m.old_pos
WHEN m.new_pos < 10 THEN m.new_pos
ELSE 10 END) "final_pos" FROM move m),
rec AS (INSERT INTO board(moves) (SELECT array_agg(cm.final_pos) FROM constrained_move cm))