This file contains 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
module Colourize | |
colour_codes = { | |
:black => 30, :white => 37, :red => 31, :green => 32, | |
:yellow => 33, :blue => 34, :magenta => 35, :cyan => 36 | |
} | |
text_effects = { | |
:blink => 5, :underline => 4, :bright => 1 | |
} |
This file contains 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
start_time = Time.now | |
STDOUT.sync = true | |
$running = true | |
$generationcount = 0 | |
def clear | |
print "\e[2J"; print "\e[0;0f" | |
end |
This file contains 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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
This file contains 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 'rubygems' | |
require 'anemone' | |
require 'redis' | |
require 'trollop' | |
require 'highline' | |
$term = HighLine.new | |
opts = Trollop::options do | |
opt :redis, "Select redis store", :default => 1 |
This file contains 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
<?xml version="1.0"?> | |
<rdf:RDF | |
xmlns:j.0="http://www.owl-ontologies.com/Ontology1326838630.owl#profile:" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" | |
xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | |
xmlns="http://www.owl-ontologies.com/Ontology1326838630.owl#" | |
xmlns:swrl="http://www.w3.org/2003/11/swrl#" |
This file contains 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
<?xml version="1.0"?> | |
<rdf:RDF | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" | |
xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" | |
xmlns:frbr="http://purl.org/vocab/frbr/core#" | |
xmlns:j.0="http://web.resource.org/cc/" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" | |
xmlns:tki="http://mms.tki.org.nz/catalogue.owl#" | |
xmlns:lom="http://www.owl-ontologies.com/lom.owl#" |
This file contains 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
# SympaSession.pm - This module includes functions managing HTTP sessions in Sympa | |
# | |
# Sympa - SYsteme de Multi-Postage Automatique | |
# Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites | |
# Copyright (c) 1997,1998, 1999 Institut Pasteur & Christophe Wolfhugel | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
This file contains 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/www/drupal/drupal-x.x/ all work with php-fastcgi | |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} |
This file contains 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 'sinatra' | |
require 'haml' | |
class String | |
def proper | |
self.split(/\s+/).each{ |word| word.capitalize! }.join(' ') | |
end | |
end | |
This file contains 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
class SSOAuth | |
require 'rubygems' | |
require 'mechanize' | |
def self.get_cookies(url) | |
h = {} | |
agent = Mechanize.new | |
agent.get(url) do |page| | |
if page.forms.first | |
agent.submit(page.forms.first) | |
agent.cookies.each do |c| |
OlderNewer