Skip to content

Instantly share code, notes, and snippets.

View Mati365's full-sized avatar
🚧
Work Work Work

Mateusz Bagiński Mati365

🚧
Work Work Work
View GitHub Profile
/*
WARNING: Do NOT edit the input and output ports in this file in a text
editor if you plan to continue editing the block that represents it in
the Block Editor! File corruption is VERY likely to occur.
*/
/*
Copyright (C) 1991-2011 Altera Corporation
Your use of Altera Corporation's design tools, logic functions
and other software and tools, and its AMPP partner logic
functions, and any output files from any of the foregoing
#include <iostream>
using namespace std;
int main() {
while(true) {
cout
<< "Pola powierzchnii figur" << endl
<< "1 - prostokat" << endl
<< "2 - kolo" << endl
#include <iostream>
using namespace std;
string asdasds(unsigned int pkt) {
if(pkt == 0 || pkt == 1) { return "mierna"; }
else if(pkt == 2 || pkt == 3) { return "niedostateczna"; }
else if(pkt == 4 || pkt == 5) { return "dostateczna"; }
else if(pkt == 6 || pkt == 7) { return "dobra"; }
else if(pkt == 8 || pkt == 9) { return "bardzo dobra"; }
#include <iostream>
using namespace std;
string asdasds(unsigned int pkt) {
switch(pkt) {
case 0: case 1:
return "mierna";
break;
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
/** wyznacznik arraya */
float fckd(float jpdl[2][2]) {
return jpdl[0][0] * jpdl[1][1] - jpdl[0][1] * jpdl[1][0];
}
#include <iostream>
#include <math.h>
using std::cout;
using std::cin;
using std::endl;
int main() {
float a, b, c;
cout
@Mati365
Mati365 / partialBind.ts
Created November 8, 2015 12:13
Underscore partial with context in typescript
_.mixin({
partialBind: (fn: Function, context: any, ...args: any[]): any => {
return _.bind(_.partial(fn, ...args), context);
}
});
<html>
<body>
<div class='kalkulator'>
<input type='text'>
<select>
<option>+</option>
<option>-</option>
<option>*</option>
<option>/</option>
</select>
@Mati365
Mati365 / shit.c
Last active September 10, 2015 10:24
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
void silnia() {
int n = 0, t = 1, i =0;
printf("Dawaj silnie:"); scanf("%d", &n);
if(n >= 0) {
for(i = 1;i <= n; ++i)
String.prototype['format'] = function(...params: any[]): string {
return this.replace(/\{(\w*)\}/g, (match, val) => {
return isNaN(val) ? params[0][val] : params[val];
});
};