Skip to content

Instantly share code, notes, and snippets.

View arbitrarily's full-sized avatar

Marko Bajlovic arbitrarily

View GitHub Profile
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active May 10, 2026 15:39
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@evanfraser
evanfraser / gravity-forms-button.php
Last active July 13, 2022 17:21
Change Gravity Forms submit input to a button element
<?php
function form_submit_button ($button, $form) {
$button = str_replace("input", "button", $button);
$button = str_replace("/", "", $button);
$button .= "{$form['button']['text']}</button>";
return $button;
}
add_filter('gform_submit_button', 'form_submit_button', 10, 5);
@SeppoTakalo
SeppoTakalo / Tune Mac OS X terminal.md
Last active December 3, 2024 05:49
Tune Mac OS X terminal

This page lists my personal preferences to set up proper command line for Mac OS X.

Change default shell to ZSH

Current default for Mac OS X Catalina, offers much better customizations that Bash.

chsh -s /bin/zsh

Install Homebrew

@dexit
dexit / api.php
Created May 3, 2019 17:32
Disable WordPress REST API endpoints
// Remove init rest routes
remove_action( 'rest_api_init', 'create_initial_rest_routes', 0 );
// Remove oembed rest routes
function remove_json_api () {
// Remove the REST API lines from the HTML Header
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
@swalkinshaw
swalkinshaw / tutorial.md
Last active January 5, 2026 14:33
Designing a GraphQL API
@zubaer-ahammed
zubaer-ahammed / Open Remote File in Sublime Text.md
Last active April 4, 2025 04:42
Open Remote File in Sublime Text (Linux Server) - Tested with Ubuntu

Open Remote File in Sublime Text:

I felt the importance of directly editing a file from a DigitalOcean droplet on my Ubuntu Server. I research on the internet and made a way to do it.

Local Machine Settings:

  1. Install "rsub" in your Sublime Text.
    • Hit Ctrl+Shift+P, start typing “install” and select “Install Package”
    • Start typing “rsub” and select it.
@bebaps
bebaps / rest-api-loop.php
Created February 22, 2017 01:26
Standard loop of posts using the WP REST API
<?php
// Standard API query arguments
$args = array(
'orderby' => 'title',
'per_page' => 3
);
// Put into the `add_query_arg();` to build a URL for use
// Just an alternative to manually typing the query string
$url = add_query_arg( $args, rest_url('wp/v2/posts') );
@koenbok
koenbok / mac-tweaks.md
Last active April 23, 2022 22:37
My Favorite Mac Tweaks

Skip verifying disk images

defaults write com.apple.frameworks.diskimages skip-verify true

Always hide the Desktop

defaults write com.apple.finder CreateDesktop false; killall Finder

Make terminal logins fast

touch ~/.hushlogin

Disable most animations

@amboutwe
amboutwe / yoast_seo_prev_next_change.php
Last active November 7, 2025 00:39
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 17, 2026 14:28
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings