Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Peter ppKrauss

🌴
On vacation
Block or report user

Report or block ppKrauss

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
@ppKrauss
ppKrauss / .block
Last active Oct 29, 2019
Brazilian States: Albers vs Mercator projections
View .block
license: mit
height: 600
@ppKrauss
ppKrauss / .block
Last active Oct 28, 2019 — forked from ruliana/.block
Brazilian States Topojson (Estados do Brasil)
View .block
license: mit
height: 600
@ppKrauss
ppKrauss / .block
Last active Sep 26, 2019
compareCurves
View .block
license: mit
@ppKrauss
ppKrauss / .block
Last active Sep 28, 2019
OLD TEST on sp-fill curves
View .block
license: mit
@ppKrauss
ppKrauss / index.html
Created Jul 5, 2019
Simple chart with C3 - in 5 minutes! // source https://jsbin.com/seriyih
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="showing C3js bug">
<meta charset="utf-8">
<title>Simple chart with C3 - in 5 minutes! </title>
<!-- Here are all the javascripts and css that you need, you can download them or linked them like here -->
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/5.9.7/d3.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/c3/0.7.1/c3.js"></script>
@ppKrauss
ppKrauss / index.html
Created Jul 5, 2019
Simple chart with C3 - in 5 minutes! // source https://jsbin.com/seriyih
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple chart with C3 - in 5 minutes! </title>
<!-- Here are all the javascripts and css that you need, you can download them or linked them like here -->
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/5.9.7/d3.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/c3/0.7.1/c3.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/c3/0.7.1/c3.css" rel="stylesheet" type="text/css">
@ppKrauss
ppKrauss / jsonb_object_summable.sql
Created Aug 16, 2018
Tool-kit for JSONb key-number objects
View jsonb_object_summable.sql
/**
* object_summable and "Merge sum" functions are for JSONb key-number objects,
* most usually key-integer for counting, like json-bags.
* They are "key counters", so, to merge two keys, the intValues must be added.
* Change the core of jsonb_merge_sum(jsonb,jsonb) to the correct datatype.
* The JSON "number" is equivalent to the SQL's ::numeric.
* Any invalid or empty JSONb object will be represented as SQL NULL.
*/
CREATE or replace FUNCTION jsonb_is_summable(jsonb) RETURNS boolean AS $f$
@ppKrauss
ppKrauss / mod-jsonrpc.sql
Created Dec 30, 2017
JSON-RPC interface for PostgreSQL 9+ JSONb frameworks
View mod-jsonrpc.sql
/**
* JSON-RPC interface. Mini-lib, independent.
* Works fine with REST.
* See http://www.jsonrpc.org/specification (only error/code convention have little change)
* Free error string code:
* "$integer" = "$integer.0" = HTTP status code (only REST)
* "$integer.$integer" = status and internal error code (DEFAULT)
* use function rpc.errcode_merge() to merge default error reference and add internal part.
*/
@ppKrauss
ppKrauss / benchmark_base.php
Last active Aug 29, 2015
Simple benchmark-base for use in any simple benchmarking task
View benchmark_base.php
<?php
/**
* Simple benchmark-base for use in any simple benchmarking task.
* Use at terminal as $php benchmark_base.php
* For more complex or memory usage, see
* http://php.net/manual/en/ref.xhprof.php
* http://php.net/manual/en/function.set-time-limit.php
* http://php.net/manual/en/features.gc.performance-considerations.php
* From https://gist.github.com/ppKrauss/4cd3c9a5f7cec89be68e
*/
@ppKrauss
ppKrauss / detect.php
Last active Aug 29, 2015
Javascript of http://www.corpuswiki.org translated to PHP and adapted for "restrict universe" option and object orientation.
View detect.php
<?php
/**
* Detect language by trigram sample analysis.
* Adapted by ppkrauss from http://www.corpuswiki.org/langdetect.html
*/
class LangDetect {
private $models;
private $universeConfig;
private $universeOnDetection;
private $isoTr3to2;
You can’t perform that action at this time.