Skip to content

Instantly share code, notes, and snippets.

Wilco van Duinkerken Sparkboxx

Block or report user

Report or block Sparkboxx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View custom_plan.rb
require 'zeus/rails'
ROOT_PATH = File.expand_path(Dir.pwd)
ENV_PATH = File.expand_path('spec/dummy/config/environment', ROOT_PATH)
BOOT_PATH = File.expand_path('spec/dummy/config/boot', ROOT_PATH)
APP_PATH = File.expand_path('spec/dummy/config/application', ROOT_PATH)
ENGINE_ROOT = File.expand_path(Dir.pwd)
ENGINE_PATH = File.expand_path('lib/my_engine/engine', ENGINE_ROOT)
class CustomPlan < Zeus::Rails
View opener-curl.md

Using OpeNER webservices using Curl

You can use the opener webservices using Curl. All components, except the language identifier, take KAF (XML) as input and output KAF. Only the language identifier takes "raw text" as an input.

To send a text to the language identifier you can use curl with the -F option to have curl read text out of files, like this:

View conclusie.txt
Testmachines
anakin.holder.nl -> Centos 5.4 on vmware, 32 bit, 1 core, 4G ram, while running a complete production stack with multiple website.
server1 @terremark -> Centos 5.4 on vmware, 32 bit, 1core, 4g ram, empty machine.
Test 1: Extracting linux kernel sources
Command: time tar xf linux-2.6.34.1.tar
Terremark: 7.329s
Anakin: 2.395s
View Currency String to Float
class Currency
def self.string_to_float(string)
string.gsub!(/[^\d.,]/,'') # Replace all Currency Symbols, Letters and -- from the string
if string =~ /^.*[\.,]\d{1}$/ # If string ends in a single digit (e.g. ,2)
string = string + "0" # make it ,20 in order for the result to be in "cents"
end
unless string =~ /^.*[\.,]\d{2}$/ # If does not end in ,00 / .00 then
string = string + "00" # add trailing 00 to turn it into cents
You can’t perform that action at this time.