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
[[ -s "/Users/dz/.rvm/scripts/rvm" ]] && source "/Users/dz/.rvm/scripts/rvm" # This loads RVM into a shell session |
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
// collections/ScheduleDayCollectionSpec.js | |
describe("ScheduleDayCollection", function() { | |
var date; | |
var schedule_days; | |
beforeEach(function() { | |
date = "2012-07-10" | |
schedule_days = new wb.ScheduleDayCollection(); | |
schedule_days.reset([{"id":"1", "date":date},{"id":"2", "date":"2012-07-11", "selected":"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
;(function(Form) { | |
var editors = Form.editors; | |
editors.List.InlineNestedModel = editors.List.NestedModel.extend({ | |
events: {}, | |
/** | |
* @param {Object} options | |
*/ |
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
ruby-1.9.2-p320: | |
system: | |
uname: "Darwin Daniels-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64" | |
system: "osx/10.8/x86_64" | |
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)" | |
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin12.0)" | |
rvm: | |
version: "rvm 1.19.5 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]" |
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
Form.editors.AutoSelect = Form.editors.Text.extend({ | |
initialize: function(options) { | |
var _this = this; | |
Form.editors.Text.prototype.initialize.call(this, options); | |
this.$el.autocomplete({ | |
... | |
select: function(event, ui) { |
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 'set default id and title', -> | |
id = 2; | |
title = "crichq"; | |
expect(id).toEqual(2); | |
expect(title).toEqual("crichq"); |
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
$ -> | |
$body = $('#question_body') | |
$counter = $('#js-body-count') | |
determineChange = -> | |
remainingChars = 140 - $body.val().length | |
if remainingChars isnt 140 | |
$counter.text remainingChars |
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
## | |
# Simple Warden configuration, complex "controller" | |
# In config/initializers/warden.rb | |
Rails.application.config.middleware.use Warden::Manager do |manager| | |
manager.failure_app = UnauthorizedController | |
end | |
# app/controllers/unauthorized_controller.rb | |
class UnauthorizedController < ActionController::Metal |
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
AllCops: | |
Excludes: | |
- setup_environment.rb | |
# Prefer a comma at the end of a multiline, to minimise diff changes and | |
# enable easier rearranging of lines. | |
TrailingComma: | |
EnforcedStyleForMultiline: comma | |
# Experimenting with the idea of having the `private`, `protected` |
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
CREATE ROLE readonly LOGIN PASSWORD 'some_pass'; | |
-- Existing objects | |
GRANT CONNECT ON DATABASE the_db TO readonly; | |
GRANT USAGE ON SCHEMA public TO readonly; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; | |
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly; | |
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO readonly; | |
-- New objects | |
ALTER DEFAULT PRIVILEGES FOR owner_user IN SCHEMA public GRANT SELECT ON TABLES TO readonly; | |
ALTER DEFAULT PRIVILEGES FOR owner_user IN SCHEMA public GRANT SELECT ON SEQUENCES TO readonly; |
OlderNewer