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 |
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
/** | |
* @overview FeatureForm.js | |
* Collection of components related to Feature Forms | |
* @author Dave Lazar | |
*/ | |
/** | |
* @namespace CCA.feature | |
*/ | |
Ext.namespace('CCA.feature'); |
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
# Example usage | |
begin | |
rs = ShopifyAPI::Order.all | |
rescue ShopifyAPI::Limits::Error | |
# Not enough credits to execute this request. Queue to DJ here, perhaps?? | |
end | |
## | |
# Redefines #find_every to automatically compose resultsets from multiple ShopifyAPI queries due to API limit of 250 records / request. | |
# Seemlessly stitches all requests to #all, #find(:all), etc, as if there were no LIMIT. |
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
if ENV["HEROKU_APP"] | |
# Spin-up workers when jobs are created | |
Delayed::Job.after :create do | |
workers_needed = [Delayed::Job.count + 1, MAX_CONCURRENT_WORKERS].min | |
@username = ENV['HEROKU_USERNAME'] | |
@password = ENV['HEROKU_PASSWORD'] | |
@app = ENV['HEROKU_APP'] | |
client = Heroku::Client.new(@username, @password) | |
client.set_workers(@app, workers_needed) | |
puts "- Initialized Heroku workers for ZipDecoder" |
OlderNewer