Skip to content

Instantly share code, notes, and snippets.

View cemfirat's full-sized avatar

Cem Firat cemfirat

View GitHub Profile
@aarongerig
aarongerig / my-app.js
Last active October 1, 2023 07:49
UIkit: Modular import
import Icons from 'uikit/dist/js/uikit-icons';
import UIkit from 'my-uikit';
UIkit.use(Icons);
<?php
// Cache the contents to a file
$cached = fopen($cachefile, 'w');
fwrite($cached, ob_get_contents());
fclose($cached);
ob_end_flush(); // Send the output to the browser

https://www.youtube.com/watch?v=oyo_oGUEH-I

ein ding was sie immer tun koennen - also, sie koennen ja nicht wirklich die kreativitaet und innovationsfaehigkeit der mitarbeiter foerdern - da muss man ja schon mal sagen, bitte unterscheiden sie bei allem, was sie tun, zwischen indirekten variablen und direkten variablen.

das ist sehr wichtig.

also, wenn mir jemand sagt, wir machen ein kulturveraenderungsprojekt, dann krieg’ ich weisse haare; jenseits der haare, die ich schon habe, die weiss sind.

weil kultur ist eine indirekte variable, kultur kann ich nicht erzeugen, kultur ist keine projektarbeit. ich kann nur rahmenbedingungen erzeugen, in denen bestimmte kulturmuster emergieren.

@lavoiesl
lavoiesl / paths.php
Last active December 8, 2017 10:12
PHP Document Root, Path and URL detection.
<?php
$base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$doc_root = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
$base_url = preg_replace("!^${doc_root}!", '', $base_dir); # ex: '' or '/mywebsite'
$protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$port = $_SERVER['SERVER_PORT'];
$disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$domain = $_SERVER['SERVER_NAME'];
$full_url = "${protocol}://${domain}${disp_port}${base_url}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.