Skip to content

Instantly share code, notes, and snippets.

from fpdf import FPDF
def generer_nombres_premiers(n):
"""Génère une liste des n premiers nombres premiers."""
premiers = []
candidat = 2
while candidat < n:
est_premier = True
candidat_range=candidat
if candidat >=3:

Regras do jogo

Cada jogador tem um determinado número de dados para lançar. Esses dados são dados normais de seis faces, exceto o 1, que é chamado de Paco, e que é uma espécie de coringa: ele representa todas as outras faces ao mesmo tempo. Assim, por exemplo, se tivermos em cinco dados Paco-dois-três-cinco-cinco, contaremos 2 dois (o verdadeiro e o Paco), 2 três (o verdadeiro e o Paco), 1 quatro (o Paco), 3 cinco (o Paco e os dois verdadeiros), ou 1 seis (o Paco).

Os lances nas faces dos dados são sempre no mínimo. Se apostar em 5 seis, é necessário que existam pelo menos 5 dados de valor seis para que o lance seja correto.

Início

import { Module } from '@nestjs/common';
import { ServeStaticModule } from '@nestjs/serve-static';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { join } from 'path';
// we serve the static content from the html folder
https://fr.camelcamelcamel.com/ <- extension pour avoir l'historique des prix
https://keepa.com/ <- pareil pour historique
https://www.idealo.fr/ - <-comparateur de prix
https://www.dealabs.com/ <- site qui repertorie des deals
@bussiere
bussiere / one_flask.py
Created May 5, 2021 10:37 — forked from mikefromit/one_flask.py
a one file flask app for trying stuff
# THIS PROJECT IS AN EXAMPLE APP. SOME CODE MAY NOT BE ACTUALLY USEFUL
# FOR DEMONSTRATION PURPOSES ONLY
# YOUR MILEAGE MAY VARY
# Requirements are Flask, Flask-WTF, Flask-SQLAlchemy
import os
from flask import (Flask,
Blueprint,
redirect,
@bussiere
bussiere / autocomplete-group-results-trevoreyre-autocomplete-js.markdown
Created April 14, 2021 09:13
Autocomplete group results - @trevoreyre/autocomplete-js

Autocomplete group results - @trevoreyre/autocomplete-js

Example of an autocomplete component using a custom renderResult function to control of rendering of items in the results list, and grouping the results into groups of 3. Using the @trevoreyre/autocomplete-js package from npm.

A Pen by Trevor Eyre on CodePen.

License.

@bussiere
bussiere / srd_5e_monsters.json
Created January 14, 2021 21:44 — forked from tkfu/srd_5e_monsters.json
A JSON file with all the D&D 5e SRD monster data
[
{
"name": "Aboleth",
"meta": "Large aberration, lawful evil",
"Armor Class": "17 (Natural Armor)",
"Hit Points": "135 (18d10 + 36)",
"Speed": "10 ft., swim 40 ft. ",
"STR": "21",
"STR_mod": "(+5)",
"DEX": "9",
@bussiere
bussiere / config.go
Created December 18, 2020 20:49 — forked from chazcheadle/config.go
Golang Viper config read into struct
package main
import (
"fmt"
"github.com/spf13/viper"
)
// Create private data struct to hold config options.
type config struct {
@bussiere
bussiere / go-worker.go
Created February 16, 2020 19:58 — forked from System-Glitch/go-worker.go
A resilient service worker written in Go
package main
// This is an example of a resilient service worker program written in Go.
//
// This program will run a worker every 5 seconds and exit when SIGINT or SIGTERM
// is received, while ensuring any ongoing work is finished before exiting.
//
// Unexpected panics are also handled: program won't crash if the worker panics.
import (
@bussiere
bussiere / cantor_pairing.go
Created February 14, 2020 20:14 — forked from dyoo/cantor_pairing.go
Cantor pairing function
// http://en.wikipedia.org/wiki/Pairing_function
package main
import (
"fmt"
"math"
)
func InvertedCantorPairing(z int) (int, int) {
w := int(math.Floor((math.Sqrt(float64(8*z+1)) - 1) / 2))