Skip to content

Instantly share code, notes, and snippets.

View 5A5K1A's full-sized avatar
🦄

Saskia Bouten 5A5K1A

🦄
View GitHub Profile
@5A5K1A
5A5K1A / index.html
Last active February 24, 2023 09:49
SVG animation logo - CODART
<div class="bg">
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 300" shape-rendering="geometricPrecision" text-rendering="geometricPrecision">
<style>
#group-25-group {
-webkit-animation: 4s linear forwards group-25_scale;
animation: 4s linear forwards group-25_scale
}
#group-25 {
@5A5K1A
5A5K1A / sql-createdb.sql
Created March 20, 2017 12:07
SQL query to create the `zichtnews` database with `comments` table (https://github.com/5A5K1A/zichtnieuws)
-- Create database: `prefix_zichtnieuws`
CREATE DATABASE IF NOT EXISTS `prefix_zichtnieuws` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `prefix_zichtnieuws`;
-- Create table `comments` including it's structure
DROP TABLE IF EXISTS `comments`;
CREATE TABLE IF NOT EXISTS `comments` (
`ID` bigint(20) unsigned NOT NULL,
`post_id` bigint(20) NOT NULL,
`author_name` varchar(100) NOT NULL,
@5A5K1A
5A5K1A / wordpress-utils.php
Created March 19, 2017 13:20
WordPress usefull utils / extra methods
<?php
/**
* Strips url from obsolete stuff, for prettier display
* @param string $url The url
* @return string The cleaned up & pretty url for displaying
*/
function studio_strip_url( $url ) {
return rtrim( str_replace(array( 'https://', 'http://', 'mailto:', 'tel:', 'www.' ), '', $url), '/' );
}
@5A5K1A
5A5K1A / index.php
Created March 2, 2017 18:52
Metatag Theme Color in head
<html>
<head>
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#177EB2">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#177EB2">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
</head>
@5A5K1A
5A5K1A / wordpress-hooks.php
Created March 2, 2017 18:40
WordPress Generic Object
<?php
/**
* Registers all ShortCode_* methods
*/
static public function Register_ShortCodes() {
// part of string to search for
$keyword = 'ShortCode_';
// loop all class methods
foreach( get_class_methods(__CLASS__) as $method ) {
@5A5K1A
5A5K1A / wordpress-hooks-admin.php
Created March 2, 2017 18:38
WordPress Tiny MCE Kitchensink
<?php
/**
* Modify TinyMCE
*
* @param array $in
* @return array $in
*/
function my_tiny_mce_before_init( $in ) {
# customize the buttons
@5A5K1A
5A5K1A / wordpress-code.php
Created March 2, 2017 18:37
WordPress Code Copy Safety
<?php
wp_die('You pasted the code without reading it...');
@5A5K1A
5A5K1A / wordpress-hooks-translate.php
Created March 2, 2017 18:31
WordPress LocoTranslate Add domain
<?php
filter_gettext( function($key, $translation, $domain) {
if( $key == $translation ) { }
if( $domain =='' ) { $domain = 'domain'; }
return __($key, $domain);
});
@5A5K1A
5A5K1A / wordpress-hooks-admin.php
Last active April 12, 2018 12:36
WordPress Admin Color Scheme
<?php
function custom_admin_color_scheme() {
wp_admin_css_color(
'scheme_name',
__('Scheme Name', 'domain'),
admin_url("/css/colors/scheme_name/colors.css"),
array('#07273E', '#14568A', '#07273E', '#07273E'),
array('base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff')
);
@5A5K1A
5A5K1A / wordpress-hooks-admin.php
Last active March 1, 2017 17:41
WordPress Change the standard WP 'Enter title here'
<?php
add_filter( 'enter_title_here', function( $title ) {
if( get_post_type() == 'page' ) {
$title = __('Vul een paginatitel in', 'domain');
} elseif( get_post_type() == 'post' ) {
$title = __('Vul een korte en bondige titel in', 'domain');
}
return $title;
});