This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# converts slippy map XYZ tile to quadkey | |
# https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system | |
as_binary = function(x){ | |
tmp = rev(as.integer(intToBits(x))) | |
id = seq_len(match(1, tmp, length(tmp)) - 1) | |
tmp[-id] | |
} | |
deg2num = function(lat_deg, lon_deg, zoom) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3 = function() { | |
var d3 = { | |
version: "3.2.7" | |
}; | |
if (!Date.now) Date.now = function() { | |
return +new Date(); | |
}; | |
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; | |
try { | |
d3_document.createElement("div").style.setProperty("opacity", 0, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <netj@sparcs.org> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server <- function(){ | |
while(TRUE) { | |
writeLines("Listening...") | |
con <- socketConnection(host="localhost", port = 6011, blocking=TRUE, | |
server=TRUE, open="w+b") | |
writeLines("con done") | |
x = unserialize(con) | |
writeLines("readRDS done") | |
writeLines(capture.output(str(x))) | |
serialize(list(response = Sys.time(), x = x), con) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create_kafka_producer = function(topic, broker_list = "localhost:9092", open = "w") { | |
prodocer_cmd = "kafka-console-producer" | |
# kafka-console-producer --topic test2 --broker-list | |
kafka_pipe = sprintf("%s --topic %s --broker-list %s", prodocer_cmd, topic, broker_list) | |
pipe(kafka_pipe, open = open) | |
} | |
# con = create_kafka_producer("test2", open = "wb") | |
# writeLines("5", con) | |
# flush(con) | |
# close.connection(con) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to install the latest stable version: | |
brew install scala --with-docs | |
# to install scala-2.10: | |
brew install https://raw.github.com/gist/4340744/scala.rb --with-docs | |
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands): | |
brew switch scala 2.9.2 | |
brew switch scala 2.10.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* White theme for reveal.js. This is the opposite of the 'black' theme. | |
* | |
* By Hakim El Hattab, http://hakim.se | |
*/ | |
section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { | |
color: #fff; } | |
/********************************************* | |
* GLOBAL STYLES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3 = function() { | |
var d3 = { | |
version: "3.2.7" | |
}; | |
if (!Date.now) Date.now = function() { | |
return +new Date(); | |
}; | |
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; | |
try { | |
d3_document.createElement("div").style.setProperty("opacity", 0, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3 = function() { | |
var d3 = { | |
version: "3.2.7" | |
}; | |
if (!Date.now) Date.now = function() { | |
return +new Date(); | |
}; | |
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; | |
try { | |
d3_document.createElement("div").style.setProperty("opacity", 0, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3 = function() { | |
var d3 = { | |
version: "3.2.7" | |
}; | |
if (!Date.now) Date.now = function() { | |
return +new Date(); | |
}; | |
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; | |
try { | |
d3_document.createElement("div").style.setProperty("opacity", 0, ""); |
NewerOlder