Skip to content

Instantly share code, notes, and snippets.

@mwygoda
mwygoda / script
Created August 31, 2017 16:57
script
<script src="src/signalr-client.js"></script>
<script>
const transportType = signalR.TransportType.WebSockets;
const http = new signalR.HttpConnection(`http://${document.location.host}/chat`, { transport: transportType });
const connection = new signalR.HubConnection(http);
connection.start();
connection.on('Send', (name, message) => {
appendLine(name, message);
});
document.getElementById('form-send').addEventListener('submit', event => {
@mwygoda
mwygoda / PWR script
Last active September 19, 2018 07:35
$('td:contains("2.0")').parent().remove();
$('td:contains("k.cz.")').parent().remove();
var sumOfEcts = 0;
var sumOfNotes = 0;
$('td[title="ocena"]').each(function(){
sumOfNotes += parseFloat($(this).text()) * parseFloat($(this).next().next().text());
sumOfEcts += parseFloat($(this).next().next().text());
});
console.log('twoja średnia to:', sumOfNotes/sumOfEcts);
import React, {Component} from 'react';
import { Redirect } from 'react-router-dom'
import toastr from 'toastr';
import validator from 'validator';
import {SignupForm} from '../components/SignupForm'
import {postRegisterData} from "../api/authenticationApi";
class Register extends Component {
constructor() {
super();
@mwygoda
mwygoda / randomSubSpace
Created December 11, 2018 15:04
randomSubSpace
# Random Forest Classification
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import time
class MeasureUnit: