Skip to content

Instantly share code, notes, and snippets.

View wehowski's full-sized avatar

Melanie Wehowski wehowski

View GitHub Profile
#!/usr/bin/env php
<?php
use Stati\Command\GenerateCommand;
use Symfony\Component\Console\Application;
use Stati\Command\ServeCommand;
$file = __DIR__.\DIRECTORY_SEPARATOR.'webfat.php';
if(!file_exists($file)){
$file = __DIR__.\DIRECTORY_SEPARATOR.'index.php';
@wehowski
wehowski / css-watcher.js
Last active November 8, 2021 19:50
frdl.registerCompnent Version2: mixes requirejs, insertionQuery/frdl.watchfo/webfan.watch, vue, angularjs, webpack, ... dirty quick started
import watchFor from './../watchFor'; // = insertionQ Alias
function watch(cssQuery, cb){
var sel = cssQuery;
var Func = function(selector, _callback){
var callback = el =>{
@wehowski
wehowski / change-state-location-detetcion-tests.js
Created November 8, 2021 19:33
patch html5 state change events mix, e.g. angularjs + 3rd. party anythings....
// :target ???
(()=>{
'use strict';
var config = {
childList: true,
subtree: true
};
var oldHref = document.location.href;
@wehowski
wehowski / browser-appcaches-killswitch.php
Created November 7, 2021 23:56
Force the browser to clear caches, cookies, ...
<?php
$settings = [
'redirect'=> [
'href' => '/',
'delay' => 5,
],
];
if(!isset($output)){
@wehowski
wehowski / Wehowski\Gist\Http\Response\Helper.php
Last active September 17, 2020 16:17
originHeaders [Wehowski\Gist\Http\Response\Helper.php]
<?php
namespace Wehowski\Gist\Http\Response;
/**
* @toDo: use libs
*/
class Helper
{
public static $protocoll = 'HTTP/1.1';
@wehowski
wehowski / RemoteFromWebfan.php
Last active August 4, 2019 20:14
Psr4 implementation for remote repository
<?php
namespace Webfan\Psr4Loader;
class RemoteFromWebfan
{
@wehowski
wehowski / Context.php
Created August 4, 2019 20:04
Template processing, braces and dot.notation {{$scope.var}}
<?php
namespace frdl;
/*
https://webfan.de/install/?salt={{salt}}&source=\frdl\Context.php
*/
class Context
{
@wehowski
wehowski / foldersize.php
Created June 14, 2019 06:57
php get directory size
<?php
function foldersize($path) {
// if (is_file($path))
$total_size = 0;
$files = scandir($path);
$cleanPath = rtrim($path, '/'). '/';
foreach($files as $t) {
if ($t<>"." && $t<>"..") {
$currentFile = $cleanPath . $t;
<?php
define('weB36Notation_Latin1_clean_finaloutput', "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
//show:
if(substr($row['WEID'], 0, 18) == '1-3-6-1-4-1-SZ5-8-' ){
$row['WEID'] = substr($row['WEID'], 18, strlen($row['WEID'])-1);
$row['WEID'] = 'weid:'.$row['WEID'];
}
<?php
// ----- GET:
$_SESSION[__DIR__.'::spamschutz'] = mt_rand(10, 99999999);
$_SESSION[__DIR__.'::spamschutz_key'] =mt_rand(10, 99999999);
echo '<input type="hidden" name="check_'.$_SESSION[__DIR__.'::spamschutz_key'] .'" value="'.sha1($_SESSION[__DIR__.'::spamschutz'] ).'" />';
// ----- POST: