Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / triangulate-topojson.js
Last active May 8, 2016 09:10
Triangulate Topojson ( => Geojson) using earcut.js
import earcut from 'earcut';
import topojson from 'topojson';
import math from 'mathjs';
const triangulateTopojson = (res) => {
const totalStart = performance.now();
const key = Object.keys(res.objects)[0];
let start = performance.now();
const geojson = topojson.mesh(res, res.objects[key]);
@korczis
korczis / deferred-compute.html
Created May 2, 2016 00:38
Example of Deferred Calculation
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
<body>
<h1>Deferred Calculation</h1>
<div id="results" style="background-color: #FF00FF"></div>
@korczis
korczis / README.md
Last active September 5, 2023 18:37
Card Trick - 673 King Street - Card Order
# the IP(s) on which your node server is running. I chose port 8080.
upstream app_mapoffacts {
server 127.0.0.1:8080 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {
listen 0.0.0.0:80;
server_name mapoffacts.com;
access_log /var/log/nginx/mapoffacts.com.log;
@korczis
korczis / save_load.json
Created November 11, 2015 08:06
Example file with serialized map - mapoffacts.com
{
"_version": 1,
"_timestamp": "2015-11-11T07:54:43.441Z",
"props": {
"layers": [
{
"name": "Layer (0)",
"id": 0,
"data": null,
"dirty": false,
@korczis
korczis / Screenshot.png
Last active November 1, 2015 16:28
React Redux Universal Hot Example Error
Screenshot.png
@korczis
korczis / inject-immutable.js
Created November 1, 2015 03:16
Short snippet for injecting immutable.js from CDN to page
var s = document.createElement('script');
s.src = 'https://cdnjs.cloudflare.com/ajax/libs/immutable/3.7.5/immutable.js'
s.onload = function() {
this.parentNode.removeChild(this);
};
(document.head || document.documentElement).appendChild(s);
@korczis
korczis / layout-full.txt
Last active September 23, 2015 19:45
The Scratch Layout
.
├── IDEAS.md
├── LICENSE
├── README.md
├── TODO.md
├── api
│   ├── README.md
│   ├── actions
│   │   ├── index.js
│   │   ├── layer
@korczis
korczis / output.txt
Last active September 2, 2015 14:25
Handcrafted piece of artwork for finding metrics containing specific word in their expression
/Users/tomaskorcak/.rvm/rubies/jruby-1.7.22/bin/jruby --1.9 -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/tomaskorcak/.rvm/gems/jruby-1.7.22/gems/ruby-debug-ide-0.4.32/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 54255 --dispatcher-port 54256 -- /Users/tomaskorcak/dev/gooddata-ruby/.scripts/services/vlada_list_metrics.rb
Fast Debugger (ruby-debug-ide 0.4.32, ruby-debug-base 0.10.5.rc10) listens on 127.0.0.1:54255
I, [2015-09-02T16:24:14.178000 #80312] INFO -- : Connected using username "[email protected]" to server https://secure.gooddata.com
I, [2015-09-02T16:24:17.830000 #80312] INFO -- : Connection successful
I, [2015-09-02T16:24:18.712000 #80312] INFO -- : Connected to server with webdav path https://secure-di.gooddata.com/uploads/
{
"metric": {
"content": {
"folders": [
"/gdc/md/la84vcyhrq8jwbu4wpipw66q2sqeb923/obj/1513"
source 'https://rubygems.org'
gem 'gooddata'
gem 'json'
gem 'pmap'