Skip to content

Instantly share code, notes, and snippets.

View rxw1's full-sized avatar
☠️

rxw1

☠️
  • Upper Silesia, Germany
View GitHub Profile
@rxw1
rxw1 / .vimrc
Created March 27, 2015 00:41
My slow vim config
" http://www.github.com/rwilhelm/dotfiles/vimrc
" Tue Jun 17 01:33:55 CEST 2014
" 2007-2014 (c) [email protected]
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@rxw1
rxw1 / .vimrc
Created March 27, 2015 00:48
My slow and old vim config
" http://www.github.com/rwilhelm/dotfiles/vimrc
" Thu Dec 19 04:03:00 CET 2013
" 2007-2013 (c) [email protected]
set nocompatible
filetype on
set viminfo+=n~/.vim/viminfo
" crontab: temp file must be edited in place

Texas, out of the 50 states:

  • Amount of carbon dioxide emissions (1st)
  • Amount of toxic chemicals released into water (1st)
  • Amount of recognized cancer-causing carcinogens released into air (1st)
  • Amount of hazardous waste generated (1st)
  • Workers' compensation coverage (50th)
  • Percent of population with a high school diploma (50th)
  • Percent of uninsured children (1st)
  • Percent of children living in poverty (4th)
  • Percent of population uninsured (1st)
@rxw1
rxw1 / index.js
Last active August 29, 2015 14:21
[koa] mount exported router
(function() {
'use strict';
/* jshint esnext:true */
var koa = require('koa');
var app = koa();
var PORT = process.env.PORT || 3333;
var router = require('./router');
@rxw1
rxw1 / index.js
Created May 30, 2015 01:56
Require all javascript files in a directory and export them by their file name
'use strict';
let fs = require('fs');
let path = require('path');
function excludeFiles(file) {
return (file.indexOf('.') !== 0) &&
(file !== 'index.js');
}
@rxw1
rxw1 / gist:47d1d2f5faffdc9eb041
Last active September 7, 2015 20:54
curl + dbpedia + ontology/Person
curl -s 'http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0APREFIX+dbpedia2%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fproperty%2F%3E%0D%0APREFIX+dbpedia%3A+%3Chttp%3A%2F%2Fdbpedia.org%2F%3E%0D%0APREFIX+skos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0D%0ASELECT+*+WHERE%0D%0A%7B+%3Fp+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPerson%3E+.%0D%0A%3Fp+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2Finfluenced%3E+%3Finfluenced.%0D%0A%3Finfluenced+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPerson%3E.
@rxw1
rxw1 / dbpedia.js
Created September 7, 2015 20:56
Query dbpedia
import fetch from 'node-fetch';
let prefix = `
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@rxw1
rxw1 / harSummarize.js
Created September 7, 2015 22:32
Summarize Human Activity Recognition (HAR) data
#!/Users/asdf/.local/opt/node/bin/node
var har2 = [
{ ts: 1000, tag: 'a' },
{ ts: 1001, tag: 'a' },
{ ts: 1002, tag: 'a' },
{ ts: 1003, tag: 'b' },
{ ts: 1004, tag: 'b' },
{ ts: 1005, tag: 'c' },
{ ts: 1006, tag: 'd' },
# search chrome history
function chrome-history () {
tmp="/tmp/history-$(now s)"
hist="/Users/$USER/Library/Application Support/Google/Chrome/Default/History"
sql="select urls.id, urls.url, urls.title, urls.visit_count, \
urls.typed_count, urls.last_visit_time, urls.hidden, urls.favicon_id, \
visits.visit_time, visits.from_visit, visits.visit_duration, \
visits.transition, visit_source.source FROM urls JOIN visits ON urls.id = \
visits.url LEFT JOIN visit_source ON visits.id = visit_source.id;"
@rxw1
rxw1 / cycle-http-driver.js
Created February 9, 2016 23:51 — forked from bouzuya/cycle-http-driver.js
cycle-http-driver.js (node-fetch)
import fetch from 'node-fetch';
import Rx from 'rx';
function makeHTTPDriver() {
var requests = {};
return function(request$) {
return request$
.filter(request => {
if (typeof request === 'undefined' || request === null) return false;
const { id } = request;