Skip to content

Instantly share code, notes, and snippets.

import re
PRECEDENCES = {'+': 2, '-': 2, '*': 3, '/': 3, '^': 4}
def has_greater_precedence(operator, comparison):
return PRECEDENCES[operator] > PRECEDENCES[comparison]
def peek(stack):
import math
def find_roots(a, b, c):
if a == 0:
return print('Erreur: a est égal à 0.')
delta = b ** 2 - 4 * a * c
print()
@felixdorn
felixdorn / css_colors.tinkerwell.php
Last active June 29, 2020 12:30
A list of built-in CSS colors
$page = Http::get('https://www.w3schools.com/cssref/css_colors.asp')->body();
$html = new Symfony\Component\DomCrawler\Crawler($page);
$names = [];
foreach($html->filter('#colornamestable .colornamespan') as $element) {
$names[] = strtolower($element->firstChild->firstChild->wholeText);
}
$values = [];
<?php
namespace Kadevland\Eloquent\Uuid\Traits;
use Kadevland\Eloquent\Uuid\Contracts\UuidGeneratorString;
use Kadevland\Eloquent\Uuid\Generators\RamseyUuid4;
trait HasUuidString
{
.input {
@apply bg-white rounded-lg w-full max-w-lg px-6 border border-gray-300 py-3 mt-2;
&::placeholder {
@apply text-gray-dark;
}
&:focus {
@apply border-opacity-0 outline-none shadow-outline-blue;
}
[
{
"name": "Omolon",
"colors": ["#091E3A", "#2F80ED", "#2D9EE0"]
},
{
"name": "Farhan",
"colors": ["#9400D3", "#4B0082"]
},
{
<?php
require __DIR__ . '/../vendor/autoload.php';
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
$payload = file_get_contents('php://input');
@felixdorn
felixdorn / .htacess
Created February 25, 2020 15:06
Laravel htacess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Keybase proof

I hereby claim:

  • I am felixdorn on github.
  • I am felixdorn (https://keybase.io/felixdorn) on keybase.
  • I have a public key ASDWPwpXeOQyfp7ZPSt1Mh24u88ybDtBaTJmpLkzn1H_pwo

To claim this, I am signing this object:

{
"13th": {
"form": "13th",
"wordnet_id": "a-02203763",
"pos": "JJ",
"sense": "coming next after the twelfth in position",
"polarity": "0.0",
"subjectivity": "0.0",
"intensity": "1.0",
"confidence": "0.9"