This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# genChoices | Gibt alle Kombinationsmöglichkeiten der Argumentenliste zurück. @ writedown.eu | |
# | |
def genChoices(*args) | |
choices = [] | |
return args if args.length <= 1 | |
(0...args.length).each { |pos| | |
if pos > 0 | |
temp = choices.dup | |
temp.each { |e| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/v0.6.1/node-v0.6.1.tar.gz | tar xz --strip-components=1 | |
sudo apt-get install libssl-dev | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl http://npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
var dns = require("dns"); | |
var u = require("util"); | |
var urls = { length: 0 } | |
http.createServer(function(req,res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
var url = req.url.replace(/^\/(https?:\/\/)?/i,""); | |
url = url.split("/")[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.IO | |
main = tictactoe | |
tictactoe = do | |
hSetBuffering stdin NoBuffering | |
play " " "qweasdyxc" 0 | |
drawTTT ttt = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "drb/drb" | |
print "port: " | |
port = gets.strip | |
raise "port is no valid" unless /^\d+$/ =~ port | |
there = DRbObject.new_with_uri("druby://localhost:#{ port }") | |
loop { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "drb/drb" | |
print "Bitte geben Sie die IP des Servers ein: " | |
ip = gets.strip | |
print "Bitte geben Sie den Port des Servers ein: " | |
port = gets.strip.to_i | |
port = 3000 if port == 0 | |
server = DRbObject.new_with_uri("druby://#{ ip }:#{ port }") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "drb/drb" | |
require "digest" | |
class Client | |
def get_binding | |
return binding | |
end | |
end | |
class Evaluator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require "net/http" | |
require "readline" | |
class Website | |
############---------------------------------------------------------- CLASS | |
@@hosts ={} # "www.23g.eu" => WebsiteObj | |
@@sessionname = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pdf-reader" | |
dateiname = [] | |
print "Bitte geben Sie die zu suchenden Worte ein: " | |
words = gets.strip.split(/\s+/mi).collect { |w| | |
dateiname << w | |
Regexp.new(w.to_s, Regexp::MULTILINE + Regexp::IGNORECASE) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class Cards | |
def initialize(*signs) | |
@colors = [:♥, :♠, :♦, :♣] | |
@valid_signs = [2, 3, 4, 5, 6, 7, 8, 9, 10, :J, :Q, :K, :A] | |
if signs.empty? then | |
signs = @valid_signs | |
end | |
signs.each { |s| |
OlderNewer