Skip to content

Instantly share code, notes, and snippets.

View jxxe's full-sized avatar

Jerome Paulos jxxe

View GitHub Profile
@jxxe
jxxe / degrees-to-cardinal.php
Last active June 4, 2022 13:25 — forked from RobertSudwarts/deg_to_cardinal.py
[PHP] Convert degrees to cardinal directions
function degreesToCardinal($degrees) {
$directions = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'];
$index = ($degrees + 11.25) / 22.5;
return $directions[$index % 16];
}
@jxxe
jxxe / remove-meta-wordpress.php
Created June 10, 2020 06:33 — forked from nbeers22/remove-meta-wordpress.php
Remove all the extra bloat of meta tags that WordPress adds to the <head> and disables the JSON API
<?php
// remove some meta tags from WordPress
remove_action('wp_head', 'wp_generator');
function remove_dns_prefetch( $hints, $relation_type ) {
if ( 'dns-prefetch' === $relation_type ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}