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
# | |
# Usage: %> rails <projectname> -m http://gist.github.com/130543.txt | |
# | |
# Install gems | |
gem 'will_paginate', :source => "http://gemcutter.org/" | |
gem "factory_girl", :source => "http://gemcutter.org/" | |
gem "formtastic", :source => "http://gemcutter.org/" | |
gem "authlogic", :source => "http://gemcutter.org/" | |
gem "rspec", :source => "http://gemcutter.org/" |
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
searchable do | |
text :name | |
string :name | |
string :phone | |
integer :review_count do | |
reviews.size | |
end | |
integer :stars | |
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
From da3be5e481fb902b15cf5d349391bae3c75f2b7e Mon Sep 17 00:00:00 2001 | |
From: Ben Yee <[email protected]> | |
Date: Wed, 19 Aug 2009 10:25:42 -0700 | |
Subject: [PATCH] add localsolr libs and bump version | |
--- | |
VERSION.yml | 4 +- | |
sunspot.gemspec | 115 +++++++++++++++++++++++++++++++++++++++++----------- | |
tasks/gemspec.rake | 2 +- | |
3 files changed, 94 insertions(+), 27 deletions(-) |
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
integer :category_ids, :multiple => true do | |
cached_displayable_categories.map{ |category| category.id } unless cached_displayable_categories.empty? | |
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
def nationwide_search | |
category_ids = self.category_ids | |
Business.search do |search| | |
search.any_of do | |
with :category_ids, category_ids unless category_ids.blank? | |
with :category_ids, nil | |
end | |
search.keywords query | |
search.order_by :name if order == :alpha | |
search.order_by :review_count, :desc if order == :review_count |
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
search = Sunspot.new_search(Business) | |
search.build do |s| | |
s.keywords "#{query} electronics" | |
s.order_by :name if order == :alpha | |
s.order_by :review_count, :desc if order == :review_count | |
s.order_by :stars, :desc if order == :rating | |
s.paginate :page => page, :per_page => per_page | |
end | |
search.query.add_component(OpenStruct.new(:to_params => { :mm => 1 })) | |
search.execute! |
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
// change city | |
$(document).ready(function() { | |
// hides the slickbox as soon as the DOM is ready | |
// (a little sooner than page load) | |
var $altCity = $('#altCity'); | |
var $altCity2 = $('#altCity2'); | |
var $altCityHide = $('#altCityHide'); | |
var $altCityShow = $('#altCityShow'); |
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
tmux -- terminal multiplexer | |
Managing tmux sessions: | |
$ tmux # start tmux server | |
$ tmux at # attach running sessions to a terminal | |
$ tmux ls # list running tmux sessions | |
Sharing sessions between terminals: | |
$ tmux new -s session_name # make new named session | |
$ tmux at -t session_name # attach to exist session (allowing shared sessions) |
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
We have an open position at Kabam for a mid-level Backend Engineer. You would be working on my game team - The Hobbit: Armies of the Third Age! | |
Some reasons to consider in addition to the stock and competitive salary reasons: | |
* Work on a modern technology stack (Node.js, Rails 3.2+, MySQL, Redis) | |
* We're agile and practice TDD in order to move fast and NOT break things :), continuous integration, and solid build processes | |
* Interesting technical problems to solve involving low-level socket programming, server infrastructure scaling, AI programming, and software design, among other things | |
* Work on a game that has the IP from one of the largest fantasy franchises in history, The Hobbit!! And we've still got two more movies to go! | |
* Awesome team of talented, easy-to-work-with peers, very supportive management | |
* Healthy, profitable company who is a leader in Free to Play gaming across multiple platforms with plans for an IPO in the future |
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
# on | |
sudo ipfw pipe 1 config bw 150KByte/s | |
sudo ipfw add 1 pipe 1 src-port 80 | |
# off | |
sudo ipfw delete 1 |
OlderNewer