Skip to content

Instantly share code, notes, and snippets.

@croraf
croraf / polygon3.js
Created October 27, 2020 00:52
Polygon3
const calculateDistance = (point1, point2) => {
return Math.sqrt((point2.x - point1.x) ** 2 + (point2.y - point1.y) ** 2);
};
const calculateVectorLength = (vector) => {
return Math.sqrt(vector.x ** 2 + vector.y ** 2);
};
const calculateScalarProduct = (vector1, vector2) => {
@croraf
croraf / polygon.js
Last active October 26, 2020 23:00
Polygon 2
const calculateDistance = (point1, point2) => {
return Math.sqrt((point2.x - point1.x) ** 2 + (point2.y - point1.y) ** 2);
}
/**
* Polygon is oriented positively, that is when traveling on it its interior is always to the left
* @param {*} polygon
* @param {*} pointP
*/
@croraf
croraf / mars_lander.js
Created October 22, 2020 19:54
Mars Lander - episode 2
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
const points = [];
const surfaceN = parseInt(readline()); // the number of points used to draw the surface of Mars.
for (let i = 0; i < surfaceN; i++) {
var inputs = readline().split(' ');

jsparagus - A parser generator

This toy parser generator spits out Python 3 code.

The input to the parser generator looks like this:

grammar = {
    'expr': [
        ['term'],
@croraf
croraf / C pattern
Created December 4, 2019 13:43
C OO pattern
```
struct MyClass;
MyClass* MyClassConstructor(int i);
void destroyMyClass(MyClass*);
void incrementMyClass(struct MyClass*);
```
```
#include "./MyClass.h"
static int main(){
Features react-data-grid react-table material-table hand-sontable ag-gird antd Kendo Syncfusion datatables.net
Stars 3.5k 7k 1k 12k 6k
Downloads 280k 1.1m 90k 190k 400k 33k 5k 550k
Bundle size 40kB 11kB 85kB 315kB 250kB 20kB 425kB 56kB
Docs traffic 95k 230k 1.3m
Row sorting free free free 💰 free free 💰 💰 free
Filtering free free free 💰 free free 💰 💰 free
Cell editing free free free 💰 free free 💰 💰
Column with groups free 💰 free free 💰 💰 free
<Table className={classes.table}>
<TableHead>
<TableRow>
<TableCell>Dessert (100g serving)</TableCell>
<TableCell align="right">Calories</TableCell>
<TableCell align="right">Fat&nbsp;(g)</TableCell>
<TableCell align="right">Carbs&nbsp;(g)</TableCell>
<TableCell align="right">Protein&nbsp;(g)</TableCell>
</TableRow>
</TableHead>

How to increase the chance of being accepted?

  • If props were added or prop types were changed, the TypeScript declarations were updated.
  • If TypeScript declarations were changed, yarn typescript passed.
  • If demos were changed, make sure yarn docs:typescript:formatted does not introduce changes. See About TypeScript demos.
@croraf
croraf / CONTRIBUTING.md
Last active September 27, 2019 19:54
CONTRIBUTING.md for material-ui

Contributing

If you're reading this, you're awesome! Thank you for helping us make this project great and being a part of the Material-UI community. Here are a few guidelines that will help you along the way.

Git workflow

  1. Fork the Material-UI repository on GitHub

  2. Clone the fork to your local machine and add upstream remote

{
"name": "dark-diagnosis-frontend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server --mode=development",
"compile": "webpack --mode=production",
"installAndCompile": "npm install && npm run compile",