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
| Todos.tasksController = SC.ArrayController.create( | |
| SC.CollectionViewDelegate, | |
| /** @scope Todos.tasksController.prototype */ { | |
| summary: function() { | |
| var len = this.get("length"), ret; | |
| if (len && len > 0) { | |
| ret = len === 1 ? "1 tasks" : "%@ tasks".fmt(len); | |
| } else { |
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
| server { | |
| location / { | |
| if (-f $document_root/system/maintenance.html) { | |
| return 503; | |
| } | |
| try_files $uri $uri/index.html @proxy; | |
| } |
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
| maintainer "Outright, Inc" | |
| maintainer_email "ops@outright.com" | |
| license "Apache 2.0" | |
| description "Installs/Configures metrics" | |
| long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) | |
| version "0.1" | |
| %w{nodejs mongodb god}.each do |d| | |
| depends d | |
| 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
| class Model < ActiveRecord::Base | |
| default_scope order("title desc") | |
| scope :with_city, lambda { |city| where("city = ?", city) } | |
| def self.search | |
| # How do I do this? Need to remove a relation | |
| self.scoped.remove(self.default_scoping).all | |
| end | |
| end | |
| Model.with_city('San Francisco').search # What I want -> select * from models where city = 'San Francisco' |
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
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
| conn = ... | |
| broadcastAddr *net.UDPAddr, request *http.Request = makeSearchRequest(st, mx) | |
| err = request.Write(func Write(p []byte) (n int, err error) { | |
| return conn.WriteTo(p, broadcastAddr) | |
| }) |
OlderNewer