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
| var jwt = JwtStore.jwt(); | |
| var otp = JwtStore.otp(); | |
| $.ajax({ | |
| url: '/api/v1/affiliates', | |
| headers: { | |
| 'Authorization': 'Bearer ' + jwt, | |
| 'Otp': otp, | |
| 'Accept': 'application/json', | |
| 'Content-Type': 'application/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
| ### Keybase proof | |
| I hereby claim: | |
| * I am 5minpause on github. | |
| * I am 5minpause (https://keybase.io/5minpause) on keybase. | |
| * I have a public key ASCT5J-ZSNPhZo8noxPXeOXBjg8sR_bbm47SY6uq5TcpQAo | |
| To claim this, I am signing this object: |
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
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
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
| var ddoc = { | |
| _id: '_design/index', | |
| views: { | |
| index: { | |
| map: function mapFun(doc) { | |
| if (doc.table_name) { | |
| emit(doc.table_name); | |
| } | |
| }.toString() | |
| } |
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
| validVinExp: function () { | |
| // WDD 169 007-1J-236589 | |
| // WDB1681331J93895 | |
| return new RegExp('^(wdb|wdd)\\s*[\\d\\s]{6,}-?[\\w\\d]{2}-?[\\d]{5,6}$', 'i'); | |
| }, | |
| evaluateVin: function (value) { | |
| return this.validVinExp().test(value); | |
| }, |
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
| [commit] | |
| template = ~/.gitmessage |
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
| $ git rev-list HEAD -count | |
| 2442 |
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
| # 50-character subject line | |
| # 72-character wrapped longer description. | |
| # Der Grund für die Änderung (Warum) | |
| # Why is this change necessary? | |
| # Wie löst es die Aufgabe (Wie) | |
| # How does it address the issue? |
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
| # This is inside Goldencobra::Permission model | |
| after_commit :set_cache_key | |
| def self.restricted?(item) | |
| @@last_permission ||= Goldencobra::Permission.reorder(:updated_at).last | |
| Rails.cache.fetch("#{@@last_permission.cache_key}#{item.cache_key}") do | |
| where(subject_class: item.class, subject_id: item.id).count > 0 | |
| 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
| def self.restricted?(item) | |
| where(:subject_class => item.class, :subject_id => item.id).count > 0 | |
| end |