Skip to content

Instantly share code, notes, and snippets.

View castlese's full-sized avatar

Emily Castles castlese

  • Dublin, Ireland
View GitHub Profile
@castlese
castlese / Taxi Fare Calculator
Last active March 17, 2021 00:12
Dublin taxi fare calculator written in java Input parameters: Journey distance (in km) Journey duration (in minutes, taken from Google Maps directions API) Current time (in milliseconds) Output parameters: An array of strings giving the following information: Minimum journey time (same as Journey duration input parameter) Minimum journey fare Ma…
import java.util.Calendar;
public class TaxiFare {
private static final String DECIMAL_POINT = ".";
private static final String EMPTY_STRING = "";
/** DECLARATION OF CONSTANTS */
/** Standard Rate - between 8am and 8pm Mon - Sat excl Public Holidays */
private static final int MIN_KM = 1;
public static final int STD_INIT = 410; /** Initial Fare - includes 1km or 170 secs */
@castlese
castlese / application.html.erb
Last active August 29, 2015 13:57
Display current github branch name in your rails app when working with Capistrano
<!-- app/views/layout/application.html.erb -->
<% if !Rails.env.production? %>
<%= branch_info %>
<% end %>
@castlese
castlese / org_chart html string
Created August 31, 2015 11:30
html string for org chart pdf export
<script type="text/javascript">
if(!window['googleLT_']){window['googleLT_']=(new Date()).getTime();}if (!window['google']) {
window['google'] = {};
}
if (!window['google']['loader']) {
window['google']['loader'] = {};
google.loader.ServiceBase = 'https://www.google.com/uds';
google.loader.GoogleApisBase = 'https://ajax.googleapis.com/ajax';
google.loader.ApiKey = 'notsupplied';
google.loader.KeyVerified = true;