This file contains hidden or 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
#!markdown | |
Records in C# | |
#!csharp | |
public class Course | |
{ | |
public string Name {get; set;} | |
public string Author {get; set;} |
This file contains hidden or 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
#!csharp | |
#r "nuget:Microsoft.Extensions.Configuration" | |
#r "nuget:Microsoft.Extensions.Configuration.Json" | |
#r "nuget:Dapper" | |
#r "nuget:Dapper.Contrib" | |
#r "nuget:System.Data.SqlClient" | |
#r "System.IO" | |
#!csharp |
This file contains hidden or 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
/* | |
React's basic components: | |
a) components - they are like functions, we invoke function with some input and they give us some output, | |
- input: props, output: UI | |
- reusable and composable | |
- <Component /> | |
- can manage a private state | |
This file contains hidden or 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
import numpy as np | |
def canPlace(x2: int, y2: int) -> bool: | |
for x in range(x2): | |
if result[x] == y2 or abs(x - x2) == abs(result[x] - y2): | |
return False; | |
return True; | |
def placeQueens(x: int) -> np.void: | |
for X in range(N): |
This file contains hidden or 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
using Xunit; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Firefox; | |
namespace DemoWebApp.Tests | |
{ | |
public class LoanApplicationTests | |
{ | |
[Fact] | |
public void StartApplication() |
This file contains hidden or 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
/* | |
Service Contracts are collections of operations or methods, | |
which take parameters and return values. | |
They provide interface for those methods. | |
Data Contracts are parameters taken by service contracts and | |
values that they return | |
Service is a class that contains implementations of those methods | |
that we want to be available for our client. |
This file contains hidden or 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
Benefits of using Webpack: | |
a) Interactive coding - instead of writing code, compiling, waiting and reloading, | |
we can use Hot Module Reload (HMR) which will only reload data that has changed. | |
So if we only changed one element on our site, then only that one element will recompile (NO RELOADING!) | |
b) Seamless compilation of anything - code, styles, layout, images, fonts, etc. | |
c) Consistent tooling - webpack is not tied to a particular IDE and/or OS | |
d) Modularity - write code with benefits of small modules, ship code in bundles | |
Which means that we can have common dependencies that are going to be loaded | |
e) Sophisticated bundling - bundle per page, bundle/code splitting, minify, lazy loading bundles, remove unused code | |
E.g. we are a gaming company and we have three games: A, B, C |
This file contains hidden or 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
yarn add @angular/core | |
is how we would add dependency to angular/core to our project. | |
It will update package.json and add dependency (it always gives latest version, like npm install --save !) | |
yarn add protrator --dev / --peer / --optional | |
is how we would add dependency to protractor to dev/peer/optionalDependencies part of package.json | |
yarn global add @angular/cli |
This file contains hidden or 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
// View | |
<h3>Tasks</h3> | |
<form data-bind="submit: addTask"> | |
Add task: <input data-bind="value: newTaskText" placeholder="What needs to be done?" /> | |
<button type="submit">Add</button> | |
</form> | |
<ul data-bind="foreach: tasks, visible: tasks().length > 0"> | |
<li> |
This file contains hidden or 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
/* | |
Abstraction means to simplify reality. | |
Example: | |
Person is an object, but if we were designing application | |
to process data about a person, then it's unlikely | |
that we will be interested in everything there is to know | |
about a person. | |
Rather you would only concern yourself with the relevant data | |
and task that we want to perform on that data. |
NewerOlder