Skip to content

Instantly share code, notes, and snippets.

View vastus's full-sized avatar
🦅
all(good)

Juho Hautala vastus

🦅
all(good)
View GitHub Profile
@vastus
vastus / model.rb
Created March 11, 2014 19:04
How to access subclasses instance variables in superclass
class Model
def self.all
puts self.table
end
class << self
attr_reader :table
end
end
Section "Monitor"
Identifier "Monitor0"
EndSection
Section "Device"
Identifier "Device0"
Driver "vesa" # driver
EndSection
Section "Screen"
class UsersController < ApplicationController
def new
@user = User.new
end
def create
user = User.new(params[:user])
user.save # breaks the: "creates a new user with the given attributes" with error: Mock "User_1001" received unexpected message :save with (no args)
render :nothing => true
end
@vastus
vastus / README.md
Last active January 3, 2018 06:22
Modal dialog for confirming the user to close the window in Qt

Confirm dialog in Qt

Compiling

Run the following commands from the project dir:

$ qmake -project && qmake && make