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
| class User < ActiveRecord:Base | |
| ROLE_TYPES = %W[Company Developer] | |
| validates_presence_of :email, :allow_blank => false, :allow_nil => false | |
| validates_uniqueness_of :email | |
| validates_email_format_of :email | |
| attr_accessible :email | |
| 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
| <?php | |
| class A { | |
| public function setSize($x, $y) { | |
| print('A'); | |
| } | |
| } | |
| class B extends A { | |
| public function setSize($x) { |
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
| In [1]: class Ellipse(object): | |
| ...: def setSize(self, x, y): | |
| ...: pass | |
| ...: | |
| ...: | |
| In [2]: class Circle(Ellipse): | |
| ...: def setSize(self, x): | |
| ...: pass | |
| ...: |
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
| #!/bin/sh | |
| TAP_INTERFACE="tap0" | |
| IMAGE_DIR="/media/files/virtual" | |
| ARGS="-enable-kvm -drive file=$IMAGE_DIR/winxp.img,index=0,cache=writeback,media=disk -boot c -net nic,vlan=0,macaddr=52:54:00:00:EE:02,model=rtl8139 -net vde,vlan=0 -m 1024 -localtime -usbdevice tablet -vga std -smb qemu -cpu Nehalem" | |
| if [ "$(lsmod | grep kvm | wc -l)" -eq 0 ] | |
| then | |
| echo "Loading KVM modules..." | |
| sudo modprobe kvm | |
| sudo modprobe kvm-intel |
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
| " place it in ~/.vim/after/syntax/python.vim | |
| " we need the conceal feature (vim ≥ 7.3) | |
| if !has('conceal') | |
| finish | |
| endif | |
| " remove the keywords. we'll re-add them below | |
| syntax clear pythonOperator | |
| syntax keyword pythonOperator is |
NewerOlder