Skip to content

Instantly share code, notes, and snippets.

View kniessner's full-sized avatar

Sascha-Darius Knießner kniessner

View GitHub Profile
@kniessner
kniessner / sgpt.md
Last active April 1, 2024 23:39
[sgpt]

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────╮ │ prompt [PROMPT] The prompt to generate completions for. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────╮ │ --model TEXT Large language model to use. [default: gpt-4-1106-preview] │ │ --temperature FLOAT RANGE [0.0<=x<=2.0] Randomness of generated output. [default: 0.0] │ │ --top-p FLOAT RANGE [0.0<=x<=1.0] Limits highest probable tokens (words). [default: 1.0] │ │ --md --no-md Prettify markdown output. [default: md] │ │ --editor Open $EDITOR to provide a prompt. [default: no-editor] │ │ --cache

@kniessner
kniessner / git-deployment.md
Created April 28, 2020 12:42 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

var d = crmAPI.contextData.target;
var url='http://orbit/?q='+d+"&t="+document.title+".mp4";
open(url);
/*
var xmlHttp = new XMLHttpRequest();
@kniessner
kniessner / no_scripts_no_styles-wp.php
Created March 18, 2019 15:16
#wp #scripts #style - remove all and speed up
/**
* Remove all java scripts.
*/
function se_remove_all_scripts() {
global $wp_scripts;
if ( is_page_template( 'blankPage.php' ) ) {
$wp_scripts->queue = array();
}
}

Keybase proof

I hereby claim:

  • I am kniessner on github.
  • I am kniessner (https://keybase.io/kniessner) on keybase.
  • I have a public key ASAYMNGe_VrJxglceTe-tHrP1KYAk9FaO765VFMWxgIwago

To claim this, I am signing this object:

@kniessner
kniessner / block_assets_gutenberg.php
Last active February 22, 2019 15:38
create block car #wp #gutenberg #block #catergory
add_action(
'enqueue_block_editor_assets',
'cmplx_enqueue_block_editor_assets'
);
function cmplx_enqueue_block_editor_assets() {
wp_enqueue_script(
'cmplx_blocks',
get_template_directory_uri().'/blocks/build/index.min.js',
@kniessner
kniessner / modular-stylesheets.php
Created February 22, 2019 15:32 — forked from nathanrice/modular-stylesheets.php
A simple proof-of-concept for modularizing the CSS for each block, and linking it "just in time".
<?php
// this snippet requires PHP 5.3+
add_action( 'wp_enqueue_scripts', function() {
wp_register_style( 'atomic-blocks/ab-cta', '/path/to/atomic-blocks/css/ab-cta.css', array(), 1.0.0 );
} );
add_filter( 'render_block', function( $block_content, $block ) {
if ( 'atomic-blocks/ab-cta' === $block['blockName'] ) {
ob_start();
wp_print_styles( $block['blockName'] );
require_once 'vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php';
/* check if user using smaller mobile device */
function my_wp_is_mobile() {
$detect = new Mobile_Detect;
if( $detect->isMobile() && !$detect->isTablet() ) {
return true;
} else {
return false;
}
<script async defer src="//assets.pinterest.com/js/pinit.js"></script>
<em><strong>Der Besuch beim Friseur des Vertrauens ist für viele Menschen wie ein Kurzurlaub - einmal New York und zurück.. Stillsitzen, gemütlich plauschen, eine entspannte Kopfmassage genießen und natürlich top gestylt aus dem Laden gehen – all das gehört zum Friseurbesuch einfach dazu. Letztendlich muss das Gesamtpaket stimmen, sodass der Kunde zufrieden ist und wieder kommt. Dies beginnt beim ersten Eindruck, dem Schaufenster. Auch wenn es sie vereinzelt noch gibt – die Zeiten von riesigen Frisuren-Postern und wilden Haarspray-Türmen im Schaufenster sind vorbei. Schaufensterdekoration für Friseurläden darf ebenso kreativ und auffällig sein wie in jedem anderen Geschäft. </strong></em>
<p dir="ltr"><em><strong>Als Türöffner für jedes Geschäft erregt das Schaufenster Aufmerksamkeit, weckt Emotionen, vermittelt wichtige Informationen und verschafft dem Passanten einen ersten Eindruck. Nutzen Sie diese Plattform auch für Ihren Friseursalo
@kniessner
kniessner / gzip.htaccess
Last active December 5, 2018 16:43
gzip htaccess config
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \