Skip to content

Instantly share code, notes, and snippets.

Mig Salazar migsalazar

Block or report user

Report or block migsalazar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ClientRfc.cs
var rfc = RfcBuilder.ForNaturalPerson()
.WithName("Miguel Angel")
.WithFirstLastName("Salazar")
.WithSecondLastName("Test")
.WithDate(1987, 04, 15)
.Build();
View Rfc.cs
public class Rfc {
//properties...
private Rfc(string tenDigitsCode, string homoclave, string verificationDigit) {
this.TenDigitsCode = tenDigitsCode;
this.Homoclave = homoclave;
this.VerificationDigit = verificationDigit;
}
View RfcBuilder.cs
private Rfc Build() {
Person person = new Person(this.Name, this.FirstLastName, this.SecondLastName, this.Year, this.Month, this.Day);
string tenDigitsCode = TenDigitsCalculator();
string homoclave = HomoclaveCalculator();
string verificationDigit = VerificationDigitCalculator();
return Rfc.Build(tenDigitsCode, homoclave, verificationDigit);
}
View RfcBuilder.cs
public class RfcBuilder {
private string Name;
private string FirstLastName;
//more properties
public RfcBuilder WithName(string name) {
this.Name = name;
return this;
}
View newrfc3.cs
Rfc rfc = new Rfc({
Name = "Mig",
FirstLastName = "Salazar",
SecondLastName = "Test",
Date = new DateTime(1987, 4, 15)
});
View newrfc2.cs
Rfc rfc = new Rfc("Test", "Salazar", "Miguel" , new DateTime(1987, 4, 15));
View newrfc.cs
Rfc rfc = new Rfc("Miguel", "Salazar", "S", new DateTime(1987, 4, 15));
@migsalazar
migsalazar / index.html
Last active Jan 6, 2018
Plotting math functions with Canvas-HTML5
View index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<canvas id="canvas" height="300px" width="500px">
Your browser doesn't support canvas
</canvas>
@migsalazar
migsalazar / canvas.4.js
Last active Jun 5, 2016
Plotting with canvas
View canvas.4.js
var xExists = [0, 2*Math.PI],
f = function(x) {
return 3*Math.sin(x) * Math.cos(x)/2;
};
plot(f, xExists);
@migsalazar
migsalazar / canvas.3.js
Created Jun 5, 2016
Plotting with Canvas
View canvas.3.js
context.beginPath();
for (var x = xstart; x < width; x++) {
xreal = (x / (xorigin)) - x0,
yreal = height - ((f(xreal) - y0) * _yscale);
context.lineTo(xreal, yreal);
}
You can’t perform that action at this time.