This file contains 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
public Enum Suit | |
{ | |
Spades, | |
Clubs, | |
Diamonds, | |
Hearts | |
} |
This file contains 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
public class Suit | |
{ | |
public static readonly Suit CLUBS = new Suit("Hearts"); | |
public static readonly Suit DIAMONDS = new Suit("Diamonds"); | |
public static readonly Suit HEARTS = new Suit("Hearts"); | |
public static readonly Suit SPADES = new Suit("Spades"); | |
private Suit(string pName) | |
{ | |
name = pName; |
This file contains 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
public class SomeClass | |
{ | |
public SomeClass() | |
{ | |
// do something awesome here | |
} | |
} |
This file contains 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
public class DBConnection | |
{ | |
private const int MAXCONNECTIONS = 5; // arbitrary | |
public DBConnection() | |
{ | |
// Oh no, what if we're over the max allowed connections! | |
} | |
} |
This file contains 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 class doesn't compile! | |
public class DBConnection | |
{ | |
public DBConnection(string pConnectionString, bool pIsTransactional) | |
{ | |
// do something mind-blowingly awesome | |
} | |
public DBConnection(string pConnectionString, bool pKeepAlive) | |
{ |
This file contains 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
public class DBConnection | |
{ | |
private const int MAXCONNECTIONS = 5; | |
private static int connectionsOpen = 0; | |
private DBConnection(){} | |
// static factory in some sort of pooling situation | |
public static DBConnection GetConnection() | |
{ |
This file contains 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
a { | |
text-decoration: none; | |
color: green; | |
} | |
a:hover { | |
text-decoration: underline; | |
} | |
a:active { | |
color: purple; | |
} |
This file contains 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
a { | |
color: green; | |
&:hover { | |
text-decoration: underline; | |
} | |
&:active { | |
color: purple; | |
} | |
&:visited { | |
color: yellow; |
This file contains 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
$main-color: #701A14; | |
$sub-color: #A64C32; | |
$accent-color: #BF8B5B; | |
/* Changing color schemes is as simple as updating the 3 lines above */ | |
p { | |
color: $main-color; | |
background-color: $sub-color; | |
.accent { | |
color: $sub-color; |
This file contains 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
@mixin colorize { | |
$color: blue; | |
$bg-color: green; | |
color: $color; | |
background-color: $bg-color; | |
} | |
p { | |
@include colorize; | |
margin-bottom: 20px; |
OlderNewer