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
# --- | |
# 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) |
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
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 |
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
<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> |
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 iPhone Simulator | |
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator | |
# Start iPhone Simulator with Performance-Debugging on | |
# See Paul Irish's Talk http://www.youtube.com/watch?v=q_O9_C2ZjoA#at=830 for details | |
CA_COLOR_OPAQUE=1 /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator |
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
<?php | |
// Usage: | |
// - Configure your secondary domain to open this file/folder. | |
// - The file will redirect to your primary domain with tracking prameters (Google Analytics used below) | |
// - Optional: Use those tracking parameters in your primary domain's index-file to set an additional tracking-snippet. See example for details. This step is necessary for stayscout since we use eTracker which does not support campaign-tracking by URL but only by calling a script after the page has been rendered. | |
// Example: | |
// http://staiscout.de -> redirects to https://stayscout.de/?utm_source=tippfehlerdomain&utm_medium=staiscout-de and adds this JS+jQuery-code at the end of the body-tag for etracker: | |
// <!-- Tippfehlerdomain-Tracking --> | |
// <script type='text/javascript'> |
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
/** | |
* How to install: | |
* 1. Open the Firefox or Chrome and Add a new Bookmark-Dialogue | |
* 2. Copy the line of JS from below and provide whatever name and shortcut-tags you whant | |
* | |
* How to use and test it: | |
* 1. Search for a place in Google Maps, click on the title to get to the place's details page. This is where google could just place a clean place-url in your browser bar but doen't. | |
* 2. Click the bookmarklet and the Page reloads so you get a clean google place URL in your browser-bar. | |
* 3. Jump to your browserbar with cmd+L (strg+L) and press strg+c to copy the clean URL. | |
**/ |
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 GoogleStaticMapHelper | |
# Creates an image tag for a static google map | |
# Learn more: http://code.google.com/intl/de-DE/apis/maps/documentation/staticmaps/ | |
# Code inspired by BillyIII's gmap2ozi http://github.com/BillyIII/gmap2ozi/tree/master | |
# TODO: Helper so ändern, dass er ein array von Adressen aufnimmt, die dann als Marker angezeigt werden. Alternativ müssen es aber Koordinaten sein... | |
def static_google_map_image_tag(markers, options = {}) | |
options.symbolize_keys! | |
url = "http://maps.google.com/maps/api/staticmap" |
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
# 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) | |
to_time = to_time.to_time if to_time.respond_to?(:to_time) | |
distance_in_minutes = (((to_time - from_time).abs)/60).round | |
distance_in_seconds = ((to_time - from_time).abs).round |
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
>> p = Project.find_by_id(1114) | |
# Project Load (1) (0.001019) SELECT * FROM `projects` WHERE (projects.deleted_at IS NULL OR projects.deleted_at > '2011-11-15 18:12:54') ORDER BY projects.id DESC LIMIT 1 | |
=> #<Project id: 1114 …> | |
>> p.pictures.count | |
# Always a sql-query | |
# SQL (1) (0.000572) SELECT count(*) AS count_all FROM `basic_pictures` WHERE (`basic_pictures`.owner_id = 8004 AND `basic_pictures`.owner_type = 'Project') AND ( (`basic_pictures`.`type` = 'ProjectPicture' ) ) | |
=> 60 | |
>> p.pictures.size |
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
// chip.de/bestenlisten/Bestenliste-Handys--index/detail/id/900/price/400/?f=0300002000010000400000000 | |
$('th.header') | |
.css('position','relative') | |
.append('<DIV class="deleter" style="top:0;position:absolute;padding:5px;">x</DIV>'); | |
$('.deleter') | |
.click( function() { | |
var $column_index = $(this).parent('th').index() + 1; | |
$('#mainTable tr').find('td:nth-child('+$column_index+'), th:nth-child('+$column_index+')').remove(); | |
} | |
); |
OlderNewer