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
| function initialize() { | |
| var map = Gmaps.map.map | |
| var defaultBounds = new google.maps.LatLngBounds( | |
| new google.maps.LatLng(<%= @lat %>, <%= @lon %>), | |
| new google.maps.LatLng(<%= @lat %>, <%= @lon %>)); | |
| map.setZoom(15); | |
| var input = (document.getElementById('place-search')); |
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
| { | |
| "$or" => [{"receivers"=>"5149fb21d863673f0f000001"}, {"actor_id"=>"5149fb21d863673f0f000001"}], | |
| "_id" => {"$ne" => "51a91dd4d8636716cc000015"}, | |
| "created_at" => {"$gt" => 2013-05-31 22:01:56 UTC}, | |
| "action" => {"$nin" => [:comment, :favorite]}, | |
| "object_type" => {"$nin" => ["User"]} | |
| } |
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 '2.0.0' | |
| gem 'rails', '3.2.14' | |
| gem 'cancan', '1.6.10' | |
| gem 'carmen-rails', '1.0.0' | |
| gem 'carrierwave', '0.9.0' | |
| gem 'carrierwave-mongoid', '0.6.1', require: 'carrierwave/mongoid' |
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 ${1:Model}sController < ApplicationController | |
| before_filter :find_${1/./\l$0/}, only: %i(show edit update destroy) | |
| def index | |
| @${1/./\l$0/}s = ${1:Model}.all | |
| end | |
| def show; end | |
| def new |
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
| # | |
| # bash completion support for core Git. | |
| # | |
| # Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
| # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
| # Distributed under the GNU General Public License, version 2.0. | |
| # | |
| # The contained completion routines provide support for completing: | |
| # | |
| # *) local and remote branch names |
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
| #Models | |
| class Event | |
| include Mongoid::Document | |
| has_and_belongs_to_many :organizations, index: true | |
| belongs_to :location, polymorphic: true, index: true | |
| end | |
| class Organization | |
| include Mongoid::Document | |
| has_and_belongs_to_many :events, index: true |
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
| [{"name":"Black Crowes","address":"Las Vegas, NV","starts_at":"2013-12-13T20:00:00-08:00","ends_at":"2013-12-14T00:00:00-08:00","time_zone":"America/Los_Angeles","venue_name":"Hard Rock Hotel and Casino Las Vegas - The Joint","html_url":"https://www.tabeso.com/events/52a19b79e76542ffc8000e2b","rsvp_url":null,"description":"","photos":[]},{"name":"Stone Temple Pilots","address":"Las Vegas, NV","starts_at":"2013-12-15T19:00:00-08:00","ends_at":"2013-12-16T00:00:00-08:00","time_zone":"America/Los_Angeles","venue_name":"Hard Rock Hotel and Casino Las Vegas - The Joint","html_url":"https://www.tabeso.com/events/52a1bbb360c564964c00396f","rsvp_url":null,"description":"","photos":[]},{"name":"Steve Miller Band and the Doobie Brothers","address":"Las Vegas, NV","starts_at":"2013-12-28T19:30:00-08:00","ends_at":"2013-12-29T00:00:00-08:00","time_zone":"America/Los_Angeles","venue_name":"Hard Rock Hotel and Casino Las Vegas - The Joint","html_url":"https://www.tabeso.com/events/52a1bcb460c56463300048db","rsvp_url":null, |
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
| /^(http(?:s)?\:\/\/[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*\.[a-zA-Z]{2,6}(?:\/?|(?:\/[\w\-]+)*)(?:|\w+\.[a-zA-Z]{2,4}?))$/ |
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
| # Instance Variable | |
| @people = [] # Array | |
| # Local Variable | |
| age = 32 # Integer | |
| weight = 195.6 # Float | |
| # = means assignment | |
| person = {} # Hash |
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 './encryptor' | |
| read_file = File.open('secret.txt') | |
| word = read_file.read | |
| read_file.close | |
| e = Encryptor.new(rand(20)) | |
| encrypted_word = e.encrypt(word) | |
| write_file = File.open('secret.txt', 'w+') |