Skip to content

Instantly share code, notes, and snippets.

View lluchs's full-sized avatar

Lukas Werling lluchs

  • Karlsruhe, Germany
View GitHub Profile
@lluchs
lluchs / itemlist.rb
Created June 19, 2011 00:05
Minecraft Wiki item list/images scraper
require 'rubygems'
require 'hpricot'
require 'mechanize'
require 'yaml'
class MCItems
Wiki = 'http://www.minecraftwiki.net'
attr_accessor :items
def initialize
@items = []
@lluchs
lluchs / search.coffee
Created July 16, 2011 14:05
Otherland Shop Search
form = '''
<form id=search>
<input type=text autofocus=autofocus><button type=submit>Suchen</button>
</form>
'''
# insert form
$('#nobotd > br').after form
form = $('#search')
@lluchs
lluchs / prices.json
Created August 7, 2011 21:58
New price JSON format
{
"shops":{
"13":"adventure",
"7":"artsupply",
"4":"bakery",
"2":"bookshop",
"5":"danger",
"12":"farm",
"20":"gadgets",
"21":"garden",
@lluchs
lluchs / make_update.bat
Created October 18, 2011 15:48
Batch script for creating Clonk updates, see http://www.ccan.de/cgi-bin/ccan/ccan-view.pl?a=view&i=4545
@ECHO OFF
color 70
cls
@ECHO For detecting differences:
@ECHO Old file? (the one which should be updated)
SET /P old=Enter:
cls
@ECHO For detecting differences:
@ECHO New file? (the file's current version)
SET /P new=Enter:
@lluchs
lluchs / ccan-framehistory.js
Created February 11, 2012 19:17
Updates the URL when browsing with frames
// @include http://ccan.de/*
// @include http://www.ccan.de/*
if(parent != window && location.pathname.indexOf('navbar') == -1) {
parent.history.replaceState(null, '', location.pathname + location.search)
}
@lluchs
lluchs / index.html
Created February 11, 2012 23:26
Regular polygon generator written with d3
<!doctype html>
<html>
<head>
<title>Polygon</title>
</head>
<body>
<section>
<form onsubmit='return false'>
<label>Number of edges: <input type=number min=3 value=5 /></label>
<label><input type=checkbox /> Show vertices</label>
@lluchs
lluchs / emailquotes.php
Created February 26, 2012 14:41
Plugin for email-style quotes in Wordpress
<?php
/*
Plugin Name: Email Quotes
Description: Allows comments to have email-style '>' quotes
Version: 1.0
Author: Lukas Werling
Author URI: http://github.com/lluchs
License: MIT
*/
add_filter('comment_text', 'emailquotes');
@lluchs
lluchs / io.go
Created June 27, 2012 13:02
Automatic github downloader
package main
import "io"
import "time"
func copySleep(dst io.Writer, src io.Reader, delay int, progress func(written int64)) (written int64, err error) {
// If the writer has a ReadFrom method, use it to do the copy.
// Avoids an allocation and a copy.
if rt, ok := dst.(io.ReaderFrom); ok {
return rt.ReadFrom(src)
@lluchs
lluchs / tabdemo.html
Created July 19, 2012 19:54
CSS tabs
<!doctype html>
<title>Tabs!</title>
<style>
p {
display: none;
}
p#tabs, p:target {
@lluchs
lluchs / embed.js
Created July 29, 2012 10:45
Local project page viewer for CCF
$('head').append('\
<link href="http://clonkforge.net/style/clonkforge.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/style/text.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/style/admin.css" type="text/css" rel="stylesheet"/>\
<link rel="stylesheet" type="text/css" href="http://clonkforge.net/style/markitup/style.css"/>\
<link href="http://clonkforge.net/style/lytebox.css" type="text/css" rel="stylesheet"/>\
<link href="style.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/includes/js/codemirror/codemirror.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/includes/js/codemirror/theme/default.css" type="text/css" rel="stylesheet"/>\
')