Skip to content

Instantly share code, notes, and snippets.

View jnv's full-sized avatar

Jan Vlnas jnv

View GitHub Profile
@josefslerka
josefslerka / dh7.R
Last active October 13, 2015 05:48
Digital Humanities 7
library(tm)
library(textcat)
library(tm)
library(tau)
library(openNLP)
inspect(havel[1:2])
havel[[1]] #pristup ke konkretnimu dokumentu
@josefslerka
josefslerka / gist:4195326
Created December 3, 2012 14:23
Digital Humanities 8 - Text mining
#
#
# https://sites.google.com/site/genbiovis/code/network
#
# natazeni knihovny
library(tm)
# nacteni korpusu
@karmi
karmi / d3.js
Last active April 18, 2016 06:13
A D3.js Tutorial: Bar Chart
!function() {
var d3 = {
version: "3.4.11"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
@danparsons
danparsons / gist:3195652
Created July 29, 2012 01:46
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@matthewp
matthewp / gist:3099268
Created July 12, 2012 16:50
XMLHttpRequest wrapped into a promise
function xhr(options) {
var deferred = Q.defer(),
req = new XMLHttpRequest();
req.open(options.method || 'GET', options.url, true);
// Set request headers if provided.
Object.keys(options.headers || {}).forEach(function (key) {
req.setRequestHeader(key, options.headers[key]);
});
@forresto
forresto / noflo.json
Last active January 16, 2017 16:32
photobooth app flowhub demo: flowhub.io/demo/photobooth/
{
"properties": {
"name": "photobooth",
"environment": {
"runtime": "html",
"src": "preview/iframe.html",
"width": 300,
"height": 300,
"content": " <video id=\"vid\" autoplay loop width=\"640\" height=\"480\" style=\"display:none;\"></video>\n <canvas id=\"out\" width=\"640\" height=\"480\" style=\"max-width:100%;\"></canvas>\n\n<input id=\"slider\" type=\"range\" min=\"0\" max=\"1\" value=\"0.5\" step=\"0.01\"></input>\n <button id=\"start\">start camera</button>\n <button id=\"prev\">prev</button>\n <button id=\"next\">next</button>\n <button id=\"save\">save</button>\n\n<style>\n #saved img { width: 160px; height: 120px;}\n</style>\n<div id=\"saved\"></div>",
"type": "noflo-browser"
@ncase
ncase / common-project.md
Last active July 5, 2017 15:33
The Common Project Project (version 0.1)

A country that's polarized is paralyzed. If we want any change in the coming years, we need to find a way to work together. However, you can't just unify people by holding hands and singing Kumbaya. No – rather than ignore or "put aside" our differences, let's use our different perspectives & interests & skills to tackle problems from all possible angles! For us to find common ground, we first need to find common goals.

This is the Common Project project.

Below, you'll find a list of projects, people, organizations, books, talks, movies, articles, and ideas that cross partisan lines to solve The Big Problems we face today. There's many such problems. And we'll need help from all sides.


@aarongustafson
aarongustafson / TinyMCE-config-HTML5.js
Created August 26, 2010 12:57
Working on a TinyMCE config that supports HTML5
// General
button_tile_map : true,
editor_selector : 'lg_mceEditor',
mode:'textareas',
theme : 'advanced',
// Cleanup/Output
apply_source_formatting : true,
convert_fonts_to_spans : true,
convert_newlines_to_brs : false,
@paf31
paf31 / node-haskell.md
Last active April 14, 2021 18:42
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces