Skip to content

Instantly share code, notes, and snippets.

View ikkez's full-sized avatar

Christian Knuth ikkez

View GitHub Profile
@ikkez
ikkez / config.ini
Created July 20, 2021 15:24
FireJWT
[FireJWT]
;##########################
; JSON-Web-Token settings
;##########################
expiration = 2592000
;##################: Method 1: HMAC SHA512
algorithm = HS512
private_key = 123456abcdef
;##################: Method 2: RSA SHA256 with 2048bit private key
@ikkez
ikkez / jsreload.js
Last active July 18, 2016 11:53
JS reload bookmarklet. Useful to reload a specific js file and re-render a DOM node on any website.
javascript:%20var%20JSreload={file:'',selector:'',rawContent:'',domContent:'',domElContent:'',init:function(){if(typeof%20jQuery==="undefined")%20alert("jQuery%20not%20loaded.");else{jQuery(document).ready(function(){JSreload.displayPanel();JSreload.load();});};},load:function(){$.ajax(window.location.href,{async:false}).done(function(data){JSreload.rawContent=data;JSreload.domContent=$.parseHTML(data);});},run:function(){var%20date=new%20Date().getTime();JSreload.file=$('#JSreload-script').val();JSreload.selector=$('#JSreload-selector').val();if(JSreload.selector=='body'){JSreload.selector='#JSreload-body';var%20data=JSreload.rawContent.replace('<body','<body><div%20id="JSreload-body"').replace('</body>','</div></body>');JSreload.domElContent=$($.parseHTML(data)).filter('#JSreload-body').html();$('body').html(JSreload.domElContent);}else{JSreload.domElContent=$(JSreload.domContent).filter(JSreload.selector).html();$(JSreload.selector).html(JSreload.domElContent);}%20$('head').append('<script%20class="JSreloa
@ikkez
ikkez / F3.xml
Created March 15, 2016 16:02
F3 Code Style [PhpStorm]
<code_scheme name="F3">
<option name="LINE_SEPARATOR" value="&#xA;" />
<option name="RIGHT_MARGIN" value="90" />
<PHPCodeStyleSettings>
<option name="CONCAT_SPACES" value="false" />
<option name="UPPER_CASE_BOOLEAN_CONST" value="true" />
<option name="UPPER_CASE_NULL_CONST" value="true" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
<option name="SPACE_BEFORE_CLOSURE_LEFT_PARENTHESIS" value="false" />
</PHPCodeStyleSettings>
@ikkez
ikkez / basicauth.php
Created April 9, 2015 12:45
F3 Single User Basic Auth Wrap
<?php
/**
* Simple Single User Basic Auth
*
* Usage:
* $auth = new \BasicAuth('admin','e9bGrU8n');
* if ($auth->basic()) { ... }
*
**/
@ikkez
ikkez / assets.html
Last active August 29, 2015 14:05
F3 Asset Manager
<html>
<head>
<title>F3 Asset Manager</title>
</head>
<body>
<h1>Asset Collector</h1>
<F3:include href="templates/assets_widget.html" />
@ikkez
ikkez / jsreload-bookmarklet.js
Last active June 5, 2018 06:22
JSReload... is a simple tool to reload a specific javascript file and rollback any DOM changes that has been had since loading the page. Just include it in your page before the JS to reload, and call $.JSreload(); in your console. JSreload bookmarklet - a little script to place in your bookmarkbar that lets you reload a specific javascript file …
javascript: var JSreload={file:'',selector:'',rawContent:'',domContent:'',domElContent:'',init:function(){if(typeof jQuery==="undefined")
alert("jQuery not loaded.");else{jQuery(document).ready(function(){JSreload.displayPanel();JSreload.load();});};},load:function(){$.ajax(window.location.href,{async:false}).done(function(data){JSreload.rawContent=data;JSreload.domContent=$.parseHTML(data);});},run:function(){var date=new Date().getTime();JSreload.file=$('#JSreload-script').val();JSreload.selector=$('#JSreload-selector').val();if(JSreload.selector=='body'){JSreload.selector='#JSreload-body';var data=JSreload.rawContent.replace('<body','<body><div id="JSreload-body"').replace('</body>','</div></body>');JSreload.domElContent=$($.parseHTML(data)).filter('#JSreload-body').html();$('body').html(JSreload.domElContent);}else{JSreload.domElContent=$(JSreload.domContent).filter(JSreload.selector).html();$(JSreload.selector).html(JSreload.domElContent);}
$('head').append('<script class="JSreload" src="'+JSreload.file+
@ikkez
ikkez / index.php
Created March 25, 2013 13:11
markdown Template Extension for F3
\Template::instance()->extend('markdown', '\ViewHelper::renderMarkdown');
$f3->route('GET /test', function($f3) {
$f3->set('str','## foo');
$f3->set('mdFile','path/to/readme.md');
echo \Template::instance()->render('test.html');
});
@ikkez
ikkez / gist:5064037
Created March 1, 2013 11:23
a F3 Template extention, to render <select> tags
/**
* sweetens <select>-TAG rendering with `group` attribute
* @param $args
* @return string
*/
static function renderSelect($args)
{
$attr = $args['@attrib'];
$tmp = \Template::instance();
foreach ($attr as &$att)
@ikkez
ikkez / dabblet.css
Created February 18, 2013 15:42
Untitled
body {
font: 100.1% "Trebuchet MS", Arial, Helvetica, sans-serif;
color: #636467;
line-height: 1.8em;
background: #333;
}
#box {
width: 220px;
height:220px;
@ikkez
ikkez / F3.xml
Created February 15, 2013 12:55
F3-Template tags autocompletion live template for PHPStorm / WebStorm IDE
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="F3">
<template name="repeat" value="&lt;repeat group=&quot;{{ @$group$ }}&quot; value=&quot;{{ @$value$ }}&quot; counter=&quot;{{ @i$i$ }}&quot;&gt;&#10;$end$&#10;&lt;/repeat&gt;" description="&lt;repeat&gt;" toReformat="false" toShortenFQNames="true">
<variable name="group" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="value" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="i" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="end" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />