Skip to content

Instantly share code, notes, and snippets.

View mxrguspxrt's full-sized avatar

Margus Pärt mxrguspxrt

View GitHub Profile
class FormModel
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
def self.form_fields
@form_fields ||= []
end
{
"font_face": "Bitstream Vera Sans Mono",
"font_size": 12,
"trim_trailing_white_space_on_save": true,
"draw_white_space": "selection",
"font_options": [ "gray_antialias" ],
"tab_size": 2,
"translate_tabs_to_spaces": true
@mxrguspxrt
mxrguspxrt / java2-home6-test.java
Created November 29, 2012 22:20
java2-home6.java
import static org.junit.Assert.*;
import org.junit.*;
public class AnswerTest {
Answer.Graph g;
Answer.Vertex v1;
@mxrguspxrt
mxrguspxrt / java2-home5.java
Created November 19, 2012 19:30
java2-home5.java
import java.util.*;
public class Answer {
public String name;
public Answer firstChild;
public Answer nextSibling;
public static <T extends Object> void p(T s){
@mxrguspxrt
mxrguspxrt / java2-home4.java
Created November 9, 2012 09:34
java2-home4.java
import java.util.*;
import java.util.regex.*;
/** Quaternions. Basic operations. */
public class Quaternion {
public double realPart;
public double i;
public double j;
public double k;
@mxrguspxrt
mxrguspxrt / riistvara-selftest3.txt
Created November 8, 2012 08:04
riistvara-selftest3.txt
Küsimus 1
Õige
Hindamata
Flag question
@mxrguspxrt
mxrguspxrt / gist:4037427
Created November 8, 2012 07:42
riistvara-selftest2.txt
Küsimus 1
Õige
Hindamata
Flag question
@mxrguspxrt
mxrguspxrt / java2-home3.java
Created October 5, 2012 07:04
java2-home3.java
public class Answer {
public static void main (String[] argum) {
Answer answer = new Answer();
}
class Linked {
public int value;
public Linked parent;
@mxrguspxrt
mxrguspxrt / tableless.rb
Created September 6, 2012 18:37
Rails Tableless
class Tableless
extend ActiveModel::Naming
extend ActiveModel::Translation
include ActiveModel::Validations
include ActiveModel::Conversion
include ActiveModel::MassAssignmentSecurity
def initialize(params={})
if params
sanitized_params = sanitize_for_mass_assignment(params)
class Class
def instance_advices(include_super=true)
throw :never_thrown
end
end
class Test1
end
class Test3 < Test1