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
var fs = require("fs"); // const | |
var qs = require("querystring"); // const | |
console.log("Start API"); // unikaj console.logów w API tego będą używac ludzie i na tej zadzadnie tworzyć interfejsy ty im niczego nie narzucaj tylko ważne informacje typu błędy mogą być wyświetlane | |
// proponował bym żeby moduł zwracał funkcje tworzącą serwer albo odrazu utworzony serwer coś jak express | |
module.exports = function (req, res) { | |
return { | |
res: res, // mozna zapisac wtedy tylko res | |
req: req, // req: req ==== req nie trzeba tyle pisać | |
ViewLang: function (static, page) { // mozna zapisac poprostu ViewLang(static, page) | |
var data = fs.readdir(static, function (err, files) { // może fat arrow ? (err, files) => {} |
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
/** Class representing a 2D vector. (X, Y)*/ | |
export default class Vector2 { | |
constructor(X = 0, Y = 0) { | |
this.X = X | |
this.Y = Y | |
} | |
/** Returns new Vector2 rotated by given angle (in radians) and any point. | |
* @param {Number} rad Angle of rotation given in radians. | |
* @param {Vector2} vector2 Point against which rotation is performed. |
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
/** Celem funkcji addLanding jest dodanie klas(y) w momęcie gdy obiekt staje się widzialny na stronie. | |
* @param {String} selector Selektor elementów. | |
* @param {String|Array<String>} className Klasa lub klasy które mają być dodane gdy element staje się widoczny. | |
* @param {Number=} offset Ile pikseli elementu musi być widoczne, domyślnie 20. | |
* @returns {void} | |
*/ | |
const addLanding = (selector, className, offset = 20) => { | |
if (!selector) throw "Podaj selektor w innym wypadku używanie tej funkcji nei ma sensu." | |
if (!className) throw "Podaj nazwę klasy w innym wypadku używanie tej funkcji nei ma sensu." | |
const found = document.querySelectorAll(selector) |
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
[{ | |
"ID": 1, | |
"Country": "Italy", | |
"Animals": [{ | |
"species": "dog", | |
"name": "Bailey", | |
"age": "5" | |
}, { | |
"species": "dog", | |
"name": "Charlie", |
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 System; | |
using System.Data; | |
using System.Windows.Forms; | |
namespace Calculator { | |
public partial class Calculator : Form { | |
public Calculator() { | |
InitializeComponent(); | |
KeyPreview = true; |
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
/** Class representing a 2D vector. (X, Y)*/ | |
export default class Vector2 { | |
constructor(X = 0, Y = 0) { | |
this.X = X | |
this.Y = Y | |
} | |
/** Returns new Vector2 rotated by given angle (in radians) and any point. | |
* @param {Number} rad Angle of rotation given in radians. | |
* @param {Vector2} vector2 Point against which rotation is performed. | |
* @returns {Vector2} |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int qpow(int base, int p){ | |
if (p == 0) return 1; | |
int value = base; | |
for (; p > 1; --p) value *= base; | |
return value; |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int qpow(int base, int p){ | |
if (p == 0) return 1; | |
int value = base; | |
for (; p > 1; --p) value *= base; | |
return value; |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace macierze | |
{ | |
// Uwagi ogólne |