Skip to content

Instantly share code, notes, and snippets.

View ramonfincken's full-sized avatar

Ramon Fincken ramonfincken

View GitHub Profile
acl country_cn src -f /etc/haproxy/subnets/CN.subnets
acl country_ng src -f /etc/haproxy/subnets/NG.subnets
acl country_ua src -f /etc/haproxy/subnets/UA.subnets
acl country_ru src -f /etc/haproxy/subnets/RU.subnets
acl network_ovh src -f /etc/haproxy/subnets/OVH.subnets
@ramonfincken
ramonfincken / Instructions.md
Last active June 1, 2016 08:20 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
@ramonfincken
ramonfincken / muplugins.sh
Created December 21, 2017 07:53
WordPress Composer multiple mu-plugins fix: muplugins.sh
#!/bash
# Author: Ramon Fincken, https://www.mijnpress.nl
BASEDIR=web/app/mu-plugins
muplugindirs=`ls $BASEDIR`
for i in $muplugindirs
do
if [[ -d ${BASEDIR}/${i} ]]
then
@ramonfincken
ramonfincken / composer.json
Created December 21, 2017 07:53
WordPress Composer multiple mu-plugins fix: composer.json (1 of 2)
"extra": {
"wordpress-install-dir": "web/wp",
"installer-paths": {
"web/app/plugins/{$name}": [
"type:wordpress-plugin"
],
"web/app/mu-plugins/{$name}": [
"type:wordpress-muplugin"
],
"web/app/themes/{$name}": [
@ramonfincken
ramonfincken / composer.json
Created December 21, 2017 07:54
WordPress Composer multiple mu-plugins fix: composer.json (2 of 2)
"scripts": {
"test": [
"web/vendor/bin/phpcs"
],
"post-update-cmd": "bash muplugins.sh",
"post-install-cmd": "bash muplugins.sh"
}
DROP TABLE `wf_fBadLeechers`, `wp_wfBlockedIPLog`, `wp_wfBlocks`, `wp_wfBlocksAdv`, `wp_wfConfig`, `wp_wfCrawlers`, `wp_wfFileMods`, `wp_wfHits`, `wp_wfHoover`, `wp_wfIssues`, `wp_wfLeechers`, `wp_wfLockedOut`, `wp_wfLocs`, `wp_wfLogins`, `wp_wfReverseCache`, `wp_wfScanners`, `wp_wfStatus`, `wp_wfThrottleLog`;
X are currently looking at this product.
jQuery(function() {
setInterval(function() {
var myDiv = jQuery("#viewing_now");
var myRand = Math.floor(Math.random() * 16) + 8;
myDiv.text(myRand);
}, 5000);
});
@ramonfincken
ramonfincken / gist:ae2859eb26ebec6cb630df1c59343cd4
Created January 11, 2021 19:56
Increase gutenberg sidebar width
add_action( 'admin_head', [ $this, 'gutenberg_sidebar_more_width' ] );
public static function gutenberg_sidebar_more_width() {
?>
<style>
@media (min-width: 782px) {
.interface-interface-skeleton__sidebar { width: 450px !important; }
.interface-complementary-area { width: 450px !important; }
}
@ramonfincken
ramonfincken / css.php
Last active September 13, 2021 11:56
Outputs minified WP Core Block styles css in footer, only the blocks you actually use in the_content()
<?php
/**
* Outputs minified WP Core Block styles css in footer, only the blocks you actually use in the_content()
* Needs wp_deregister_script( 'wp-block-library' );
*
* @author Ramon Fincken, ManagedWPHosting.nl
*
* @param string $block_content
* @param array $parsed_block
* @return string
@ramonfincken
ramonfincken / read.php
Created December 31, 2023 01:27
Read i3d status page
<?php
$url = 'https://status.i3d.net/';
function get_page_as_string( $url ) {
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_VERBOSE, 0 );
curl_setopt( $ch, CURLOPT_HEADER, 0 );