Skip to content

Instantly share code, notes, and snippets.

View pixelbart's full-sized avatar
🫥
Hidden

Kevin Pliester pixelbart

🫥
Hidden
View GitHub Profile
@pixelbart
pixelbart / check_http_codes.php
Last active November 17, 2016 10:48
HTTP-Code überprüfen, URls ausgeben und bei Fehler eine Mail senden
<?php
/**
* Prüft HTTP Header und gibt den Status aus
* Ist die gewünschte Seite nicht erreichbar, wird man automatisch kontaktiert.
*
* @author Kevin Pliester
* @url https://kevinpliester.de
* @license MIT
* @url https://opensource.org/licenses/MIT
*
@pixelbart
pixelbart / .htaccess
Last active April 10, 2017 10:37
Browser Caching with .htaccess
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|ttc|ttf|woff)$">
@pixelbart
pixelbart / external-links.js
Created November 8, 2016 10:04
jQuery: open external links in a new tab!
@pixelbart
pixelbart / wp_database_url.sql
Created November 2, 2016 11:26
Change urls in wp database
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@pixelbart
pixelbart / Contact.class.php
Last active October 12, 2016 10:29
German: Simple PHP Contact Form
<?php
/**
* Contact Form Class
*
* @author Pixelbart
* @version 1.0
*/
class Contact
{
@pixelbart
pixelbart / 9dbe2e11d1d2b222b2c22144b1d39185.md
Created October 9, 2016 13:52
Windows 10 zurücksetzen und in der Zwischenzeit

Windows 10 zurücksetzen und in der Zwischenzeit...

Steam lief wieder mal nicht so wie es soll und mein PC irgendwie auch nicht mehr so doll. Dann kann ich ja die Zurücksetzen-Funktion von Windows 10 testen und mich wieder ein bisschen mit meinem Linux (Xubuntu) Notebook beschäftigen, wo ich auch gerade drauf schreibe.

Ich möchte in Zukunft wieder mehr bloggen, weiß aber noch nicht so richtig womit. Wäre super, wenn du da einen Vorschlag hast. Mir ist WP to much für ein paar Beiträge im Monat.

Vielleicht bastele ich auch mein eigenes flat file CMS. Sicherheit ist mir bei einem Blog ja nicht ganz so wichtig.

Ein kleines Cleanup in meinem Github Profil!

Falls du dich wunderst, warum mein Profil so sauber ist: Ich habe ein bisschen aufgeräumt und im Zuge dessen auch ausgemistet.

Ich hatte Github nicht so ganz verstanden, als ich das Profil erstellt hatte. Jetzt bin ich ein Pro-Coder-Brain und kenne mich ein wenig besser aus.

:)

@pixelbart
pixelbart / pagenavi.php
Last active October 4, 2016 04:07
WordPress Pagenavi
<?php
/**
* Pagenavi
*/
function pagenavi()
{
if( is_singular() )
return;
@pixelbart
pixelbart / json-check.php
Created September 24, 2016 19:22
Simple JSON login function
<?php
$files = array();
$login_nick = null;
$login_pass = null;
//* loop all user files in users/ with file ending .json
foreach(glob('users/*.json') as $file) :
//* put json file contents into the users array
@pixelbart
pixelbart / custom-post-type-team-query.php
Created September 24, 2016 01:32
Custom Post Type Query: Team
<?php
$args = array(
'post_type' => 'team', // Unser post-type sprich team
'post_status' => 'publish', // Es sollen nur Beiträge mit den Status "veröffentlicht" ausgeben werden
'posts_per_page' => -1 // Es sollen alle Beiträge auf der Seite angezeigt werden
);
$the_query = new WP_Query( $args ); // Unser WordPress Query, mit dem wir die Beiträge ausgeben werden
if ( $the_query->have_posts() ) :