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
LanguageTranslation | |
has_many :dependencies, :after_remove => :on_remove_dependency | |
private | |
def on_remove_dependency(dep) | |
if dependencies.count == 0 | |
# if this phrase is no longer pointed-to, destroy self | |
self.destroy | |
end | |
end |
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 GeoKit | |
#It is half of the earth circumference in pixels at zoom level 21. | |
#You can visualize it by thinking of full map. Full map size is 536870912 × 536870912 pixels. | |
#Center of the map in pixel coordinates is 268435456,268435456 which in latitude and longitude would be 0,0. | |
PIXEL_OFFSET = 268435456 | |
PIXEL_RADIUS = PIXEL_OFFSET / Math::PI | |
module Mappable | |
module ClassMethods |
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
object: | |
{ | |
"location": { | |
"coords": { | |
"latitude": [Float], | |
"longitude": [Float] | |
"accuracy": [Float] | |
"speed": [Float], | |
"heading": [Float], |
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
Basel.mainPage = SC.Page.design({ | |
// The main pane is made visible on screen as soon as your app is loaded. | |
// Add childViews to this pane for views to display immediately on page | |
// load. | |
mainPane: SC.MainPane.design({ | |
childViews: [SC.TabView.design({ | |
value: 'Welcome', | |
items: [{ | |
title: 'Welcome', value: 'welcome' |
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
// ========================================================================== | |
// Project: Basel - mainPage | |
// Copyright: ©2010 My Company, Inc. | |
// ========================================================================== | |
/*globals Basel */ | |
// This page describes the main user interface for your application. | |
Basel.mainPage = SC.Page.design({ | |
// The main pane is made visible on screen as soon as your app is loaded. |
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
desc "modulate <theme> <hue> <saturation> <lightness>", "Modulate a theme. Specify h, s, l as floats, eg: 1.5" | |
def modulate(theme, hue, saturation, lightness) | |
ExtJS::Theme.each_image {|img| | |
path = img.filename.split('/') | |
filename = path.pop | |
dir = path.pop | |
say_status("modulate", File.join(dir, filename)) | |
ExtJS::Theme.write_image(img.modulate(lightness.to_f, saturation.to_f, hue.to_f), File.join(ExtJS::Theme["theme_dir"], theme)) | |
} | |
gsub_file(File.join(ExtJS::Theme["theme_dir"], theme, "defines.sass"), /\$hue:\s?(.*)/, "$hue: #{(hue.to_f-1)*180}") |
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
/** | |
* @class Foo | |
* @singleton | |
*/ | |
Foo = (function() { | |
return { | |
/** | |
* getFoo | |
*/ | |
getFoo: function() { |
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
/** | |
* @class Ext.ux.PinOverlap | |
* An Ext.CompositeElement extension which intelligently moves dom-elements so they don't overlap each other. | |
* Created for clustering markers on a Map to not overlap. First picks the most efficient direction to move-off | |
* of overlapped element, keeping track of where it moved from. If it overlaps another, it'll back-track and attempt | |
* to move around the element based upon the MOVE_* CONSTANTS below. Eg. | |
* | |
* +--------------------------- | |
* | +-------------------+ | |
* | | | |
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
/** | |
* Loads an array of {@Ext.data.Model model} instances into the store, fires the datachanged event. This should only usually | |
* be called internally when loading from the {@link Ext.data.Proxy Proxy}, when adding records manually use {@link #add} instead | |
* @param {Array} records The array of records to load | |
* @param {Boolean} add True to add these records to the existing records, false to remove the Store's existing records first | |
*/ | |
loadRecords: function(records, add) { | |
if (!add) { | |
this.data.clear(); | |
} |
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
class ActiveResource::Connection | |
# HACK 1: Add an attr_reader for response | |
attr_reader :response | |
def request(method, path, *arguments) | |
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload| | |
payload[:method] = method | |
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}" | |
payload[:result] = http.send(method, path, *arguments) | |
end |
OlderNewer