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
{"title":"Anonymous Gistbook","author":"Anonymous","pages":[{"pageName":"","sections":[{"type":"text","source":"Welcome to Gistbook!"},{"type":"html","source":"<h1>test</h1>"},{"type":"css","source":"h1 { color: red; }"},{"type":"javascript","source":"alert('welcome to the internet');"}]}],"public":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
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# ' | |
\set PROMPT2 '[more] %R > ' | |
-- By default, NULL displays as an empty space. Is it actually an empty | |
-- string, or is it null? This makes that distinction visible. | |
\pset null '[NULL]' | |
-- Use table format (with headers across the top) by default, but switch to | |
-- expanded table format when there's a lot of data, which makes it much | |
-- easier to read. | |
\x auto | |
-- Verbose error reports. |
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 https://github.com/discourse/discourse/blob/21e08a423e8839c6bacb4ee688b924a4fb71113f/lib/middleware/turbo_dev.rb | |
# lib/middleware/turbo_dev.rb | |
module Middleware | |
# Cheat and bypass Rails in development mode if the client attempts to download a static asset | |
# that's already been downloaded. | |
# |
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 Allocation < AR::Base | |
# allocations schema | |
# - line_item_id - indexed | |
# - type - string [ ‘CreditAllocation’, ‘DebitAllocation’ ] - indexed | |
# - allocatable_id - integer - indexed | |
# - amount - integer | |
belongs_to :line_item | |
belongs_to :allocatable, class_name: ‘LineItem’ | |
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
{ | |
"animation_enabled": false, | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_with_fields": true, | |
"bold_folder_labels": true, | |
"caret_extra_width": 2, | |
"caret_style": "phase", | |
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme", | |
"copy_with_empty_selection": false, | |
"create_window_at_startup": false, |
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
DeviceCloud.event_notification_processors = [ ParkingSessionEventHandler, ParkingLotEventHandler, PermitPurchaseEventHandler ] | |
DeviceCloud.event_notification_handler = Proc.new do |event_notification| | |
DeviceCloud.event_notification_processors.each { |processor| processor.perform_async(event_notification.raw_data) if processor.processable?(event_notification.type) } | |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch('config/environments/test.rb') | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('Gemfile') | |
watch('Gemfile.lock') | |
watch(%r{^spec/factories/.+\.rb$}) |
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
irb(main):001:0> ActivityFeedItem.all | |
ActivityFeedItem Load (4.1ms) SELECT "activity_feed_items".* FROM "activity_feed_items" | |
=> [#<ActivityFeedItem id: 1, municipality_id: 1, nickname: "Coin Door Closed", item_type: "sentry_alert", title: "coin_vault_door_closed", text: "DIGI DUAL 2: Coin Door Closed ", created_at: "2013-07-24 21:03:30", updated_at: "2013-07-24 21:03:30">] | |
irb(main):002:0> ActivityFeed.feed 1, 1 | |
ActivityFeedItem Load (787.7ms) SELECT "activity_feed_items".* FROM "activity_feed_items" WHERE (id in ('1','30','29','28','27')) | |
=> [#<ActivityFeedItem id: 1, municipality_id: 1, nickname: "Coin Door Closed", item_type: "sentry_alert", title: "coin_vault_door_closed", text: "DIGI DUAL 2: Coin Door Closed ", created_at: "2013-07-24 21:03:30", updated_at: "2013-07-24 21:03:30">] | |
irb(main):003:0> ActivityFeed.feed 1, 1 | |
ActivityFeedItem Load (1.6ms) SELECT "activity_feed_items".* FROM "activity_feed_items" WHERE (id in ('1','30','29','28','27')) | |
=> [#<ActivityFeedItem id: 1, municipality_id: 1, |
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 A < ActiveRecord::Base | |
serialize :foo, FooSerializer | |
class FooSerializer | |
attr_accessor :attributes, :to, :be, :serialized | |
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
Time::DATE_FORMATS.merge!( | |
datetime_military: '%Y-%m-%d %H:%M', | |
datetime: '%Y-%m-%d %I:%M%P', | |
time: '%l:%M%p', | |
time_with_zone: '%l:%M%p %Z', | |
time_military: '%H:%M%P', | |
datetime_short: '%m/%d %I:%M', | |
date: '%e', | |
day: '%a', | |
time_zone: '%Z', |