Skip to content

Instantly share code, notes, and snippets.

View tordans's full-sized avatar

Tobias tordans

View GitHub Profile
@tordans
tordans / data-extractor.html
Created March 17, 2011 22:52
Quick and dirty JavaScript that exports station-data. Find the final dataset at http://goo.gl/iDo0N
<html>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<h1>Find the final data at http://goo.gl/iDo0N</h1>
<table>
<tr>
<td>Station_ID</td><td>Site_ID</td><td>Site_Name_JP</td><td>Site_Name_EN</td><td>Prefecture_ID</td><td>Prefecture_Name_JP</td><td>Prefecture_Name_EN</td><td>Station</td><td>Station_Name_JP</td><td>-</td><td>Station_Name_EN</td><td>Latitude</td><td>Longitude</td>
@tordans
tordans / ApplyAxureTableStyleToAllTables.bas
Created October 11, 2010 13:55
Read more about this macro for Axure Wireframing-Software at http://uxzentrisch.de/tipps-fuer-axure-konzepte/
Sub ApplyTableStyle()
'
' ApplyTableStyle Makro
' Weist die ausgewählte Tabellenformatvorlage zu.
' More: http://uxzentrisch.de/tipps-fuer-axure-konzepte/
'
' THX @ http://www.wordbanter.com/showthread.php?t=142309
'
Dim t As Table
@tordans
tordans / application_helper.rb
Created September 27, 2010 12:47
Eine pragmatische Lösung für das Übersetzungsproblem der Rails Methode distance_of_time_in_words(). Im Deutschen wird je nach Satzbau eine andere Ausgabe benötigt.
# ---
# Code gehört in app/helpers/application_helper.rb (oder einen anderen Helper…)
# ---
# Ausgabe: "Vor mehr als 5 Monaten"/"Vor etwa einem Jahr" — statt "Dauer: mehr als 5 Monate"/"Dauer: etwa 1 Jahr", wie es die Originalfunktion liefert
# Original-File: actionpack/lib/action_view/helpers/date_helper.rb, line 63
# Dokumenation: http://apidock.com/rails/v2.3.8/ActionView/Helpers/DateHelper/distance_of_time_in_words
# Changelog: I18n.with_options-Scope geändert auf "distance_in_words_gebeugt"
def distance_of_time_in_words_gebeugt(from_time, to_time = 0, include_seconds = false, options = {})
from_time = from_time.to_time if from_time.respond_to?(:to_time)