Skip to content

Instantly share code, notes, and snippets.

using System;
using Xunit;
namespace Inline_Out_Variables_Csharp
{
public class UnitTest1
{
[Fact]
public void ParseEmptyGuid_Test_CsharpSyntax_7()
{
using System;
using Xunit;
namespace Inline_Out_Variables_Csharp
{
public class UnitTest1
{
[Fact]
public void ParseEmptyGuid_Test_OlderCsharpSyntax()
{
using System;
var myUrl = new MyURL();
//prints out https://localhost:8080/myCustomer
Console.WriteLine($"{myUrl}");
return 0;
public class MyURL
var myUrl = new MyURL();
//prints out https://localhost:8080/myCustomer
Console.WriteLine($"{myUrl}");
return 0;
public class MyURL
{
private const string protocol = "https";
using System;
var myUrl = new MyURL();
//prints out https://localhost:8080/myCustomer
Console.WriteLine($"{myUrl}");
return 0;
public class MyURL
@jindeveloper
jindeveloper / nodejs_installer.ps1
Created January 10, 2021 16:11 — forked from nweldev/nodejs_installer.ps1
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"
const employees =
[{
employee: 'Eleanor R. Crane',
company: 'Tellus Faucibus Leo Incorporated',
dailyRate: 0,
salary: 15200
},
{
employee: 'Haviva E. Lane',
company: 'Eu Neque Pellentesque Incorporated',
const TOTAL_WORKING_DAYS = 261;
//Horrible in my opinion, worst someone will say it is ugly.
const dailyRate = (item, index, array) => array[index].dailyRate = Math.floor(((item.salary * 12) / (TOTAL_WORKING_DAYS)));
//undefined as forEach doesn't return any results.
let dailyRateEmployeeResults = employees.forEach(dailyRate);
console.log(dailyRateEmployeeResults);//undefined
const TOTAL_WORKING_DAYS = 261;
const getDailyRate = salary => Math.floor(((salary * 12) / (TOTAL_WORKING_DAYS)));
const dailyRate = employee => Object.assign({}, { employee: employee.employee, dailyRate: getDailyRate(employee.salary) });
//Returns a new set of empoloyees with dailyRate and name
const newEmployees = employees.map(dailyRate);
//new data
/*forEach loop*/
let amounts = [1.25, 2.25, 3.25, 4.25];
/**
* Outputs:
* 1.25
* 2.25
* 3.25
* 4.25
*/