Skip to content

Instantly share code, notes, and snippets.

@CoHyper
CoHyper / index.php
Last active April 27, 2024 15:58
PHP Excel lesen
<?php
// Pfad zur Excel-Datei
// Beachte, dass die Datei im CSV-Format vorliegen muss
// Wenn deine Excel-Datei im .xls oder .xlsx-Format vorliegt, müsstest du die Datei zunächst in das CSV-Format konvertieren
$excelFile = 'example.csv';
// Datei öffnen
$file = fopen($excelFile, 'r');
@CoHyper
CoHyper / review.php
Last active April 22, 2024 16:40
jr_review
<?php
// Verbindung herstellen
$conn = new mysqli($servername, $username, $password, $database);
// Verbindung überprüfen
if ($conn->connect_error) {
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
@CoHyper
CoHyper / foo.php
Last active April 27, 2024 16:06
PHP 2 dimensional Array
<?php
function getData()
{
$data = [
["username" => "Sven", "datum" => "donnerstag", "soll" => 1, "ist" => 2],
["username" => "Sven", "datum" => "freitag", "soll" => 1, "ist" => 2],
["username" => "Lars", "datum" => "donnerstag", "soll" => 1, "ist" => 2],
["username" => "Lars", "datum" => "samstag", "soll" => 1, "ist" => 2],
["username" => "Lars", "datum" => "samstag", "soll" => 2, "ist" => 3]
@CoHyper
CoHyper / bash.sh
Last active April 27, 2024 16:05
bash new GIT Repo
git init
git add README.md
git commit -m "Erster Commit"
git commit -M main
git remote add origin url_des_remote_repositories
git push -u origin main
@CoHyper
CoHyper / rechneStundenProProjekt.js
Last active April 10, 2024 05:22
rechneStundenProProjekt
function rechneStundenProProjekt(ist, soll) {
var mehrStundenInProzent = 0;
var wenigerStundenInProzent = 0;
switch (true) {
case soll - ist > 0:
mehrStundenInProzent = (100 / ist) * soll - 100;
break;
case soll - ist < 0:
wenigerStundenInProzent = 100 - (100 / ist) * soll;
<?php
/**
th {
/*
double, solid, dashed, dotted, ridge, outset, groove', and the lowest: inset*/
border: 2px solid blue;
display: table-cell;
padding: 10px;
vertical-align: top;
@CoHyper
CoHyper / table.html
Last active February 23, 2024 18:45
Table with cellpadding, cellspacing, border in CSS
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Table Style</title>
<style>
.cell-8 {
width: 100%;
}
@CoHyper
CoHyper / single-pdf.php
Last active February 20, 2024 06:33
Single PDF of FDPI
<?php
use setasign\Fpdi\Fpdi;
// or for usage with TCPDF:
// use setasign\Fpdi\Tcpdf\Fpdi;
// or for usage with tFPDF:
// use setasign\Fpdi\Tfpdf\Fpdi;
// setup the autoload function
@CoHyper
CoHyper / merge.php
Last active April 27, 2024 16:08
PHP mergePDF
<?php
/**
* @api https://github.com/Setasign/FPDI
* @require php "^8.2.12" - "^5.6 || ^7.0 || ^8.0"
* @require "ext-zlib": "*"
* @require "setasign/fpdf": "^1.8",
* @require "setasign/fpdi": "^2.6"
*/
@CoHyper
CoHyper / settings.json
Last active August 5, 2024 00:40
vscode
{
/*
Twiggy
Composer
DatabaseClient JDBC
ftp-kr
Modern-Twig
Open in SourceTree
Open PHP/HTML/JS in Browser
PHPDOC Commaent