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
class Vehicle | |
drive: -> | |
alert "The vehicle moves forward!" | |
class Motorcyle extends Vehicle | |
drive: -> | |
alert "The Motorcyle moves forward!" | |
class Car extends Vehicle | |
drive: -> |
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
/* style.scss */ | |
@mixin colorize { | |
$color: blue; | |
$bg-color: green; | |
color: $color; | |
background-color: $bg-color; | |
} | |
p { |
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
p { | |
color: blue; | |
background-color: green; | |
margin-bottom: 20px; } |
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; |
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
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
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
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
// 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; // arbitrary | |
public DBConnection() | |
{ | |
// Oh no, what if we're over the max allowed connections! | |
} | |
} |