Skip to content

Instantly share code, notes, and snippets.

Avatar

Jørgen Orehøj Erichsen joerichsen

View GitHub Profile
View gist:8540567
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>
View gist:5106936
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 Jun 5, 2012
Microgem for compiling assets in parallel
View parallel_assets_compiler.gemspec
# -*- 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 Dec 9, 2010
A version that works with with the newest savon version
View gist:735296
# 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 Oct 31, 2010
Querying the e-conomic.dk API using Savon and Ruby
View gist: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
client = Savon::Client.new do
wsdl.document = "https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL"
end
# Authenticate
View import_folder_to_evernote.sh
#!/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
View gist:591364
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"]
View prettier_version.rb
# 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")
View gist:582124
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"
})
View gist:385761
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.
#
You can’t perform that action at this time.