Skip to content

Instantly share code, notes, and snippets.

Avatar
🎹
I'm either playing keyboard or coding.

Guilherme Soster GSoster

🎹
I'm either playing keyboard or coding.
View GitHub Profile
@GSoster
GSoster / basic-point.cs
Last active Jan 14, 2019
blog post - shallow vs deep copy
View basic-point.cs
Public Point
{
public int X { get; set; }
public int Y { get; set; }
public Point(int x, int y)
{
X = x;
Y = y;
}
@GSoster
GSoster / Point.cs
Last active Jan 14, 2019
Blog Post - CSharp Operator Overloading
@GSoster
GSoster / comparison.cs
Last active Jan 14, 2019
dotnetOperatorOverloading1
View comparison.cs
public static bool operator > (Point a, Point b)
{
return a.X > b.X;
}
public static bool operator < (Point a, Point b)
{
return a.X < b.X;
}
@GSoster
GSoster / constructor-complete.js
Last active Jan 16, 2019
roll-a-die blog post
View constructor-complete.js
constructor(props) {
super(props);
this.state = {
faceValue: 0,
face: "&#x2680;",
rollCount: 1,
isRolling: false,
};
this.DiceRoll = this.DiceRoll.bind(this);
this.HandleDiceThrow = this.HandleDiceThrow.bind(this);
View using-keyword-compiler-translated.cs
{
StreamReader sr = new StreamReader(filename);
try
{
String text = sr.ReadToEnd();
return text;
}
finally
{
if (sr != null)
@GSoster
GSoster / array-reduce-empty.js
Last active Sep 22, 2017
Array.reduce in Javascript - blog post
View array-reduce-empty.js
[].reduce(function(a, b){
return a + b;
});
You can’t perform that action at this time.