Skip to content

Instantly share code, notes, and snippets.

View sofasurfer's full-sized avatar

Kilian sofasurfer

View GitHub Profile
/*
Ihr aktueller Verbrauch
*/
// Nutzenergie
var usable_energy = $('#w_first_result_nutz').val();
if($('#w_second_result_nutz').val() > 0 ){
usable_energy = (+usable_energy + +$('#w_second_result_nutz').val());
}
@sofasurfer
sofasurfer / wp_import.php
Created April 8, 2020 14:27
Create custom posts from json
<?php
// Load WP Core
require_once( dirname(".") . "/cms/wp-load.php" );
// Load race jSon
$races_string = file_get_contents("races.json");
$races_json = json_decode($races_string, true);
@sofasurfer
sofasurfer / twitter.php
Created November 6, 2019 13:17
Twitter Feed Class
<?php
/*
Retrieves twitter feed
*/
class SocialFeed {
@sofasurfer
sofasurfer / conf.php
Created August 24, 2018 09:48
WP Disable Updates
<?php
/**
* Disable the Plugin and Theme Editor.
*
* Occasionally you may wish to disable the plugin or theme editor to prevent overzealous users from being able to edit
* sensitive files and potentially crash the site. Disabling these also provides an additional layer of security if a hacker
* gains access to a well-privileged user account.
*
* @see https://codex.wordpress.org/Editing_wp-config.php#Disable_the_Plugin_and_Theme_Editor
*/
<?php
/*
General settings
*/
define('FEED_CACHE_TIME', $modx->getOption('socialfeed.cachetime'));
define('FEED_CACHE_PATH', $modx->getOption('socialfeed.cachepath'));
/*
Instagram settings
*/
<html>
<header>
<style>
.logo svg path{
fill: aqua!important;
}
</style>
</header>
<bod>
@sofasurfer
sofasurfer / nginx_redmine_host_file
Created February 11, 2012 22:32
NGINX Redmine Host File
# NGINX Redmine Virtual Host Config
# @sofasurfer.org
server {
listen 80;
server_name *.myredmine.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
@sofasurfer
sofasurfer / nginx_wp_host_file
Created February 11, 2012 22:31
NGINX WordPress Host File
# NGINX WordPress Virtual Host Config
# @sofasurfer.org
server {
listen 80;
server_name *.mywordpress.com;
root /var/www/mywordpress/;
index index.php;
client_max_body_size 30M;
@sofasurfer
sofasurfer / nginx_modx_host_file
Created February 11, 2012 22:25
NGINX MODX Host File
# MODX Redmine Virtual Host Config
# @sofasurfer.org
server {
listen 80;
server_name *.mymodx.com *.amazonaws.com;
root /var/www/mymodx;
index index.php;
client_max_body_size 30M;
@sofasurfer
sofasurfer / modx-formlog.php
Created January 28, 2012 04:56
MODX FormLog hook to store formIt data in a jSon log file
<?php
/**
* MODX FormLog hook to store formIt data in a jSon log file
*
* @author Kilian Bohnenblust (sofasurfer.org)
* @example [[!FormIt?
* &hooks=`spam,formlog,email,redirect`
* &logfile=`[[++base_path]]assets/data/form-contact.log`
*
*/