Skip to content

Instantly share code, notes, and snippets.

@batazo
batazo / cas.js
Created June 4, 2021 04:28 — forked from torjusti/cas.js
Simple equation solving hack in JavaScript
// Prototype that stores information about a given polynomial.
function Polynomial(data) {
// Support providing already existing Polynomials.
this.polynomial = data instanceof Polynomial ? data.polynomial : data;
}
// Rank all coefficients in the polynomial and return the largest.
Polynomial.prototype.getLargestCoefficient = function() {
var re = /(\d+)/g, match, max = 0;
while(match = re.exec(this.getPolynomial()))
@batazo
batazo / dashboard.css
Last active June 8, 2021 20:03
UserSystem-Dashboard (Frontend for UserSystem Backend)
input {
padding: 5px;
background: #30302d14;
outline: none;
font-size: 18px;
border-radius: 8px;
box-shadow: inset 2px 2px 7px -1px grey;
}
button {
@batazo
batazo / src-App-Routes.php
Last active June 13, 2021 18:11
Slim 4 - Authentication middleware
<?php
use \App\Controllers\Tests;
use \App\Middleware;
$app->get('/tests/testroute/{name}', Tests\newTestController::class . ':getT')->add(new Middleware\testMiddleware());
@batazo
batazo / src-Controllers-Tests-newTestController.php
Created June 13, 2021 20:43
Slim 4 - Authentication middleware (with TOKEN)
<?php
namespace App\Controllers\Tests;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
//use Slim\Psr7\Response;
use Slim\Views\PhpRenderer;
public function getT(Request $request, Response $response, $args) {
//$name = $args['name'];
@batazo
batazo / A user-template-with-bind.markdown
Last active August 10, 2021 19:32
User Template with BIND
@batazo
batazo / A webdeveloper-quiz-v14.markdown
Last active August 10, 2021 19:33
Webdeveloper Quiz v14

Webdeveloper Quiz v14

Responsive Quiz Game built with HTML5 , CSS3 and Javascript.

A Pen by Bzozoo on CodePen.

License.

@batazo
batazo / dom-element-factory.markdown
Created August 10, 2021 19:35
DOM ELEMENT FACTORY
@batazo
batazo / A jquery-animated-aquarium-css.markdown
Last active August 10, 2021 19:38
Jquery Animated Aquarium CSS