Skip to content

Instantly share code, notes, and snippets.

View fanda's full-sized avatar

Pavel Novotný fanda

View GitHub Profile
@fanda
fanda / harvested.d
Last active March 16, 2016 08:06
Harvester
import std.stdio; // : writeln, writefln, File;
import std.functional;
import std.string;
import std.array : split;
import vibe.d;
import vibe.db.redis.redis;
import std.process;
import yaml;
shared static this()
@fanda
fanda / mpdp.rb
Created March 15, 2016 22:25
MPDP - Ruby GTK client for MPD server
#!/usr/bin/ruby
require 'rubygems'
require 'gtk2'
require 'librmpd'
require 'find'
require 'pp'
$mpd = MPD.new 'localhost', 6600
$mpd.connect
@fanda
fanda / server.conf
Created March 15, 2016 22:16
Nginx HTTP gateway with authentication against PostgreSQL
server {
listen 80;
server_name auth.localdomain;
root /home/fanda/devel/static/auth/;
index auth.html;
error_page 403 /account.html;
@fanda
fanda / script.coffee
Created March 15, 2015 20:02
Ractive register+login
AuthForm = new Ractive({
el: '#AuthForm'
template: '#AuthFormT'
data: {
sitename: 'Register/Login'
user: {
name: null
password: null
}
domain: 'ifanda.cz'
@fanda
fanda / pingWebsite.js
Last active August 29, 2015 14:13 — forked from Marak/isTheWebsiteDown.js
Checks to see if a website is down
var http = require('http');
module['exports'] = function pingWebsite (hook) {
var sites = [
'http://trikoko.herokuapp.com',
'http://www.fitcor.cz',
'http://www.vystavuj.cz'
];
for(url in sites) {
http.get(url, function(res){
set expandtab
"set guifont=-*-luxi\ mono-medium-r-normal-*-12-*-*-*-*-*-ISO-8859-2
set guifont=Luxi\ Mono\ 12
set helplang=cs
set history=50
set hlsearch
set incsearch
set mouse=a
set ruler
set showcmd
@fanda
fanda / gist:47c2b9b71a8f6b41d188
Created December 17, 2014 21:38
Strip trailing whitespace
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
@fanda
fanda / Gemfile
Created September 26, 2012 20:53
Multipage Sinatra Contact Form App with Javascript Client
source 'http://rubygems.org'
gem "thin"
gem "sinatra"
gem "sinatra-jsonp"
gem "pony"