Skip to content

Instantly share code, notes, and snippets.

View joerichsen's full-sized avatar

Jørgen Orehøj Erichsen joerichsen

  • erichsen.net
  • Århus, Denmark
View GitHub Profile
Inicia la sessió <a href="http://www.equipsport.cat">Equipsport.cat</a>
<form accept-charset="UTF-8" action="http://www.equipsport.cat/sessions" method="post" target="_blank">
<label for="username">Nom d'usuari</label>
<input class="textfield" id="username" name="username" type="text">
<label for="password">Contrasenya</label>
<input class="textfield" id="password" name="password" type="password">
<input type="submit" value="Inicia la sessió">
<a href="http://www.equipsport.cat/forgot_password">Has oblidat la contrasenya?</a>
</form>
Log på <a href="http://www.holdsport.dk">Holdsport</a>
<form accept-charset="UTF-8" action="http://www.holdsport.dk/sessions" method="post" target="_blank">
<label for="username">Brugernavn</label>
<input class="textfield" id="username" name="username" type="text">
<label for="password">Adgangskode</label>
<input class="textfield" id="password" name="password" type="password">
<input type="submit" value="Log på">
<a href="/forgot_password">Glemt adgangskode?</a>
</form>
@joerichsen
joerichsen / parallel_assets_compiler.gemspec
Created June 5, 2012 06:23
Microgem for compiling assets in parallel
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'parallel_assets_compiler'
s.version = '0.2.0'
s.platform = Gem::Platform::RUBY
s.author = 'Jørgen Orehøj Erichsen'
s.email = 'joe@erichsen.net'
s.summary = 'Compile assets in parallel'
s.description = 'Compile assets in parallel to speed up deployment'
@joerichsen
joerichsen / gist:735296
Created December 9, 2010 20:35
A version that works with with the newest savon version
# Old version is here
# https://gist.github.com/657153
# In Gemfile
gem 'savon', :git => 'http://github.com/rubiii/savon.git', :branch => 'eight'
gem 'httpclient'
# Run this in the console to fetch the name and address of the first debtor
HTTPI::Adapter.use = :net_http
client = Savon::Client.new do
@joerichsen
joerichsen / gist:657153
Created October 31, 2010 21:06
Querying the e-conomic.dk API using Savon and Ruby
# In Gemfile
gem 'savon', :git => 'http://github.com/rubiii/savon.git', :branch => 'eight'
gem 'httpclient'
# Run this in the console to fetch the name and address of the first debtor
client = Savon::Client.new do
wsdl.document = "https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL"
end
# Authenticate
#!/bin/sh
find . -name '*.pdf' | cut -f 2- -d '.' | xargs -I {} echo `pwd`{} | xargs -I {} echo 'tell application "Evernote" to create note from file "{}"' | /usr/bin/osascript
require 'savon'
client = Savon::Client.new "http://aws.hvm.dk/GetAddressService/GetAddressService.asmx?wsdl"
# Show the methods available
client.wsdl.soap_actions
# [:get_post_code_list, :get_address_access_by_street_code, :get_region_list, :get_address_access_by_named_street_uid, :get_municipality_by_municipality_code, :get_address_access_by_uid, :get_municipality_list, :get_address_specific_by_address_access_uid, :get_named_street_by_street_code, :get_post_code_by_post_code_identifier, :get_named_street_by_uid]
# Get an array of region names
client.get_region_list.to_hash[:get_region_list_response][:region].map { |region| region[:region_name] }
# Result ["Nordjylland", "Midtjylland", "Syddanmark", "Hovedstaden", "Sj\303\246lland"]
# Get a sorted list of Danish zipcodes using the webservice described here
# http://www.ebst.dk/aws
#
# Install savon with: gem install savon and try it out
require 'savon'
client = Savon::Client.new "http://aws.hvm.dk/GetAddressService/GetAddressService.asmx?wsdl"
puts client.get_post_code_list.to_hash.values.first[:postal_code_list].map { |postal_code_entry| postal_code_entry[:post_code_identifier] + " " + postal_code_entry[:district_name] }.sort.join("\n")
response = Net::HTTP.post_form(URI.parse('http://www.cpsms.dk/sms/'),
{'username' => username, 'password' => password,
'recipient' => user.preference.sms_no,
'message' => 'Dejlig sms fra os',
'from' => 'FraOs',
'utf8' => 1,
'url' => "http://eksempel.dk/sms"
})
require 'test/unit'
require 'test/unit/testresult'
Test::Unit.run = true
module Hydra #:nodoc:
# Hydra class responsible for running test files.
#
# The Runner is never run directly by a user. Runners are created by a
# Worker to run test files.
#