Skip to content

Instantly share code, notes, and snippets.

View pschyska's full-sized avatar
🤔
Aber das geht doch besser‽

Paul Schyska pschyska

🤔
Aber das geht doch besser‽
View GitHub Profile
require "test_helper"
class TierMembershipTest < ActiveSupport::TestCase
context "associations" do
should belong_to :user
should belong_to :tier
end
class TierMembership < ActiveRecord::Base
attr_accessible :tier, :user
belongs_to :tier
belongs_to :user
validates :user_id, presence: true
validates :tier_id, presence: true, uniqueness: { scope: :user_id }
validate :valid_user_role
class Backend::Settings::TiersController < BackendController
before_filter :authorize_admin
def index
@tiers = current_company.tiers.order('sort ASC')
end
def update
@tier = current_company.tiers.find(params[:id])
require 'test_helper'
class TierTest < ActiveSupport::TestCase
context "validations" do
should validate_uniqueness_of(:name).scoped_to(:company_id)
end
context "associations" do
should belong_to :company
// Legacy cm.e support
if (cm.e) {
snippetNeedsUpdating = true;
// Process queued errors
for (var i=0; i < cm.e.length; i+=1) {
cm.onerror.apply(this, cm.e[i]);
}
// Override push to immediately call onerror
cm.e.push = function(message, file, line, column) {
cm.onerror(message, file, line, column);
{ "order": {
"id": 1,
"client_id": "815",
"articles": [
{"title": "Lonestar Beer",
"id": 666,
"links":[
{ "rel": "self",
"href": "http://articles/lonestarbeer"}
]}
" Highlight currently open file in nerdtree
" see http://superuser.com/a/474298/175466
" see http://superuser.com/a/509721/175466
" returns true iff is NERDTree open/active
function! rc:isNTOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" returns true iff focused window is NERDTree window
.cols
position: absolute
top: $header-height
bottom: 0
left: $navigation-width
right: 0
.col
position: absolute
top: 0
bottom: 0
package main
import ("fmt")
func main() {
π();
}
func π() {
fmt.Printf("christmas!");
package main
import ("fmt")
func main() {
סּںסּَ();
☃();
}
func סּںסּَ() {