Skip to content

Instantly share code, notes, and snippets.

View ionurboz's full-sized avatar

Onur ionurboz

View GitHub Profile
@ionurboz
ionurboz / README.md
Created March 4, 2024 11:34 — forked from abelcallejo/README.md
The missing is_posts_page() function of WordPress

is_posts_page()

Returns boolean whether the current page is the posts page as set from the dashboard.

@ionurboz
ionurboz / replace-wp-dashboard.php
Created January 30, 2024 13:55 — forked from wpscholar/replace-wp-dashboard.php
Replace the default WordPress dashboard with a custom one
<?php
/**
* Plugin Name: Replace WordPress Dashboard
* Description: Replaces the default WordPress dashboard with a custom one.
* Author: Micah Wood
* Author URI: http://micahwood.me
* Version: 0.1
* License: GPL3
*/
@ionurboz
ionurboz / ajaxListener.js
Created February 16, 2023 14:32 — forked from icodejs/ajaxListener.js
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@ionurboz
ionurboz / wp-routes.php
Created May 25, 2021 07:07 — forked from bradt/wp-routes.php
WordPress Routes
<?php
function bt_register_routes( $routes ) {
foreach ( $routes as $route_name => $args ) {
bt_register_route( $route_name, $args );
}
}
function bt_register_route( $route_name, $args = array() ) {
$args = wp_parse_args( $args, array(
'query_var' => 'route_' . $route_name,
@ionurboz
ionurboz / auto-login.php
Created October 28, 2020 07:38 — forked from bradt/auto-login.php
Automatic Logins for WordPress
<?php
class DBrains_Auto_Login {
protected static $_instance = null;
function __construct() {
global $wpdb;
$this->expires = DAY_IN_SECONDS * 30 * 4;
$this->table = $wpdb->prefix . 'dbrns_auto_login_keys';
@ionurboz
ionurboz / complete-whois-server-ist.md
Last active June 3, 2024 21:00
Complete Whois server list

Complete Whois server list

(<!-- Mirrored from(\s|\S)*?GMT -->)
@bwonur
bwonur / htaccess.expires.headers.htaccess
Last active July 18, 2019 10:51 — forked from solancer/htaccess.expires.headers
htaccess expires headers
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
@gapple
gapple / .htaccess
Created July 16, 2017 06:50
htaccess gzip/brotli-bomb
<IfModule mod_rewrite.c>
RewriteEngine On
<IfModule mod_headers.c>
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME} wp-login.php
RewriteRule ^(.*)$ bomb-32G.brotli [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} wp-login.php
@icodejs
icodejs / ajaxListener.js
Created July 26, 2012 16:47
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +