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
# Package generated configuration file | |
# See the sshd_config(5) manpage for details | |
# What ports, IPs and protocols we listen for | |
Port 2109 | |
# Use these options to restrict which interfaces/protocols sshd will bind to | |
#ListenAddress :: | |
#ListenAddress 0.0.0.0 | |
Protocol 2 | |
# HostKeys for protocol version 2 |
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 { | |
#server_name example.com www.example.com; | |
# Make site accessible from http://localhost/ | |
server_name _; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
root /vagrant/prosper202; | |
index index.php; |
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
# If you change this file, run 'update-grub' afterwards to update | |
# /boot/grub/grub.cfg. | |
# For full documentation of the options in this file, see: | |
# info -f grub -n 'Simple configuration' | |
GRUB_DEFAULT="Xen 4.1-amd64" | |
GRUB_HIDDEN_TIMEOUT=0 | |
GRUB_HIDDEN_TIMEOUT_QUIET=true | |
GRUB_TIMEOUT=10 | |
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` |
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
source 'https://rubygems.org' | |
ruby '1.9.3' | |
gem 'rails', '3.2.11' | |
gem 'activeadmin' | |
gem 'activerecord-postgres-hstore' | |
gem 'acts_as_list' | |
gem 'airbrake' | |
gem 'apn_sender', require: 'apn' |
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
{ | |
"feed_items" = ( | |
{ | |
avatar = "<null>"; | |
"created_at" = 1354554275; | |
"event_type" = "task_completed"; | |
feedable = { | |
object = { | |
big = "http://rylyty-production.s3.amazonaws.com/app/public/assets/tasks/76/50/original?1354554272"; | |
comment = jgdfhj; |
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 PushNotifier | |
def send_notification_to_user_limited(user, message) | |
if (user.last_apn_send_date.nil? || Time.now - 12.hours > user.last_apn_send_date) | |
send_notification_to_user(user, message) | |
user.last_apn_send_date = Time.now | |
user.save | |
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
require './spec/support/factories.rb' | |
user = FactoryGirl.create(:user) | |
game = FactoryGirl.create(:photo_game) | |
task = game.tasks.last | |
task.timeout_secs = 20 | |
task.save | |
app.post '/api/v1/login', login: user.username, password: 'secret' | |
app.post "/api/v1/games/#{game.id}/buy.json" |
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 yield_for name, default = "" | |
output = content_for(name) | |
output.blank? ? default : output | |
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
it 'should contain a collection of games' do | |
game1 = FactoryGirl.create(:game, titel: 'foo1') | |
game2 = FactoryGirl.create(:game, titel: 'foo2') | |
get :index | |
json = ActiveSupport::JSON.decode(response.body) | |
json[:game].size == 2 | |
end | |
it 'should contain the title of the game' do | |
game = FactoryGirl.create(:game, titel: 'foo1') |
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 Geo | |
include Mongoid::Document | |
BERLIN_LOCATION = [52.51171, 13.44325] | |
index({ 'location' => '2d' }) | |
field :location, type: Array #0: latitude, 1: longitude | |
scope :nearby, ->(location, distance) { where('location' => {'$within' => | |
{ '$center' => [location, distance], '$uniqueDocs' => true }})} | |
scope :berlin, -> {nearby(BERLIN_LOCATION, 2)} |