Skip to content

Instantly share code, notes, and snippets.

View Voker57's full-sized avatar

Voker57 Voker57

View GitHub Profile
module Text.JSON.JPath (jPath) where
import qualified Data.Map as Map
import Data.Maybe
import Text.JSON
import Text.ParserCombinators.Parsec.Combinator
import Text.ParserCombinators.Parsec.Char
import Text.ParserCombinators.Parsec.Prim
data Element = ObjectLookup String | ArrayLookup Int deriving (Show)
<?php
// RIP LyricWiki. You were rather good.
// This script has the same interface as late LyricWiki
// Returning format is html only
error_reporting(0);
function encode($wtf)
{
return urlencode(preg_replace("/\\s+/","_",$wtf));
}
$artist = encode($_REQUEST["artist"]);
# Reploy example, see http://bitcheese.net/wiki/reploy/examples
require 'reploy'
Reploy.load(:host => "example.com",
:user => "user",
:path => "/var/www/example.com",
:recipes => ["git", "merb", "rsync"],
:copy => [["config/database.yml","config"]],
:store_backups => false,
require 'reploy'
Reploy.load(:host => "example.com",
:user => "username",
:path => "/var/www/example.com",
:recipes => ["git","scp"])
local defaults={
-- 500 or less makes seconds increment relatively smoothly while playing
update_interval=500
}
local settings=table.join(statusd.get_config("xmms2"), defaults)
local xmms2_timer
local function get_xmms2_status()
#!/bin/sh
usage()
{
echo "Usage: dump <file|image|text> [file] [language]"
}
case $1 in
file)
URL=`curl -w %{redirect_url} -F "file=@$2" http://dump.bitcheese.net/upload-file?simple`
#!/usr/bin/zsh
# Simple ADOM savegame backuper
# Usage: ./aadom.zsh <savename>
# Requires git and ADOM in $PATH
cd /$HOME/.adom.data/savedg
if [ ! -d .git ]; then
git init
fi
while [ true ]
do
@Voker57
Voker57 / dick.rb
Last active September 4, 2015 06:25
"dick" plugin for rbot
class DickPlugin < Plugin
def name
"dick"
end
def help(plugin, topic="")
"Adds a bit of huymor to russian words"
end
def hui(m, params)
#!/bin/sh
if test "$(file -b --mime-type `which $1`)" == "text/x-python"; then
echo "Run for your lives!!!"
else
echo "No python"
fi
class FireUrlPlugin < Plugin
def fireurl(m, params)
u = URI.parse(params[:what])
if u.path
path = u.path
path.gsub! %r|([^/]+)| do |s|
URI.escape(s, /./)
end
u.path = path
end