Skip to content

Instantly share code, notes, and snippets.

View rxw1's full-sized avatar
☠️

rxw1

☠️
  • Upper Silesia, Germany
View GitHub Profile
@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 / 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 / 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');

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 / .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
@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 / backup.sh
Created March 20, 2015 02:03
Colorful backups
#!/usr/local/bin/zsh -e
# Fri Mar 20 03:01:41 CET 2015
# [email protected] (c) MMXV
zmodload -F zsh/stat b:zstat
test `which lolcat` && alias -g RAINBOW="|lolcat" || alias -g RAINBOW=""
test ! $BACKUPDIR && BACKUPDIR=backups
echo -e "\e[1;37mcreating backups ...\e[0m"
for f in $@; do
backupdir=$BACKUPDIR/`zstat -F '%Y/%m/%d' +mtime -- $f`
backupfile=$backupdir/$f.`date +%Y%m%d`.tar.bz
@rxw1
rxw1 / Makefile
Last active August 29, 2015 14:17
OS X Yosemite 10.10.x mDNSResponder vs. discoveryd Makefile
LAUNCH_DAEMONS = /System/Library/LaunchDaemons
MDNSRESPONDER = com.apple.mDNSResponder.plist
MDNSRESPONDER_HELPER = com.apple.mDNSResponderHelper.plist
DISCOVERYD = com.apple.discoveryd.plist
DISCOVERYD_HELPER = com.apple.discoveryd_helper.plist
install: copy-files unload-discoveryd load-mDNSResponder
uninstall: unload-mDNSResponder load-discoveryd remove-files
clear-caches: clear-mdns-cache clear-udns-cache
reload-discoveryd: unload-discoveryd load-discoveryd
@rxw1
rxw1 / org.asdflabs.screenbla.plist
Last active October 25, 2016 17:16 — forked from joostrijneveld/scpscreenshots.sh
Upload Screenshot – Get Link
<!--
OS X launchd plist: Copy to ~/Library/LaunchAgents
and launch with launchctl load ~/Library/LaunchAgents/org.asdflabs.screenbla.plist.
Make sure the path to the shell script is correct.
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
gpg-export-my-key() {
gpg --armor --export $EMAIL
}
gpg-encrypt-eof() {
cat << EOF | gpg --encrypt --armor -r $EMAIL | curl -sF 'f:1=<-' ix.io | pbcopy
}
gpg-decrypt-paste() {
pbpaste | gpg --decrypt