This file contains hidden or 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
Joosy.namespace 'Urls', -> | |
class @NewPage extends ApplicationPage | |
@layout ApplicationLayout | |
@view 'new' | |
@mapElements | |
'form': '#new_url' | |
@mapEvents |
This file contains hidden or 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 ActiveAdmin | |
class ResourceController < BaseController | |
def clean_search_params(search_params) | |
super.delete_if do |key, value| | |
value == [""] | |
end | |
end | |
end | |
end |
This file contains hidden or 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
<script type="text/javascript"> | |
if (localStorage['data/categories'][0] === '{') { | |
localStorage['data/categories'] = "[" + localStorage['data/categories'] + "]"; | |
} | |
if (localStorage['data/session'][0] === '{') { | |
localStorage['data/session'] = "[" + localStorage['data/session'] + "]"; | |
} | |
if (localStorage['data/counters'][0] === '{') { |
This file contains hidden or 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
grunt.initConfig | |
testem: | |
'core-jquery': | |
src: [ | |
'bower_components/jquery/jquery.js', | |
'core/*.coffee' | |
], | |
options: | |
launch_in_dev: ['PhantomJS'], | |
launch_in_ci: ['PhantomJS', 'Chrome', 'Firefox', 'Safari', 'IE7', 'IE8', 'IE9'] |
This file contains hidden or 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
ActiveAdmin::FormBuilder.class_eval do | |
def has_many(association, options = {}, &block) | |
options = { :for => association }.merge(options) | |
options[:class] ||= "" | |
options[:class] << "inputs has_many_fields" | |
# Add Delete Links | |
form_block = proc do |has_many_form| | |
# @see https://github.com/justinfrench/formtastic/blob/2.2.1/lib/formtastic/helpers/inputs_helper.rb#L373 | |
contents = if block.arity == 1 # for backwards compatibility with REE & Ruby 1.8.x |
This file contains hidden or 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
for value in @values | |
sum = 0 | |
costs.push [] | |
for pair in value | |
costs.last().push pair[0] | |
sum += pair[0] | |
totalHeights.push sum |
This file contains hidden or 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
require "rubygems" | |
require "bundler/setup" | |
require "eventmachine" | |
require "thin" | |
require "sinatra/base" | |
EventMachine.run do | |
class App < Sinatra::Base | |
get '/' do |
This file contains hidden or 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 of HTTP API documentation format based on Apiary blueprint | |
== transport | Transport system | |
Markdown description of an entity goes here. | |
== transport/cards | Customers' cards | |
@keyword [string] Keyword of a card |
This file contains hidden or 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
create_shortage = -> | |
shortage = 0 | |
percents.each (x, i) -> | |
if x < 15 | |
percents[i] = 15 | |
shortage += 15 - x | |
shortage |
This file contains hidden or 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
# match 'api/wsdl', ... | |
Rails.application.routes.routes.named_routes['api_wsdl'].app.instance_variable_get("@controllers")['api'].try(:'clear!') |
NewerOlder