Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🖖
Live long and prosper!

Alex Zappa reatlat

🖖
Live long and prosper!
View GitHub Profile
@reatlat
reatlat / no_mp.bat
Created April 8, 2024 23:46 — forked from natesubra/no_mp.bat
Disable Windows Defender - Powershell
# disable
powershell -command 'Set-MpPreference -DisableRealtimeMonitoring $true -DisableScriptScanning $true -DisableBehaviorMonitoring $true -DisableIOAVProtection $true -DisableIntrusionPreventionSystem $true'
# Or exclude
powershell -command 'Add-MpPreference -ExclusionPath "c:\temp" -ExclusionProcess "c:\temp\yourstuffs.exe"'
@reatlat
reatlat / function.php
Created March 22, 2024 04:18 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@reatlat
reatlat / countries-with-states-provinces-regions.js
Last active February 14, 2024 00:06 — forked from shanebo/countries-with-states-provinces-regions
All countries with their states/provinces/regions in json
var countries = {
"Afghanistan": [
"Badakhshan",
"Badghis",
"Baghlan",
"Balkh",
"Bamian",
"Daykondi",
"Farah",
"Faryab",
@reatlat
reatlat / example.html
Last active February 12, 2024 01:30 — forked from hijonathan/example.html
Generate a unique id in a Jinja template.
<!-- Jinja Unique ID Generator -->
{% macro random_int(len) -%}
{% for n in range(len) %}
{{ [0,1,2,3,4,5,6,7,8,9]|random }}
{% endfor %}
{%- endmacro %}
{% macro unique_id(count_groups=5, group_len=6, separator='-') -%}
{% set parts %}
@reatlat
reatlat / slugify.twig
Last active July 29, 2023 18:49 — forked from xavianaxw/slugify.html
Hubspot | slugify() | Converting text into slug for Hubspot
{# Helpers: slugify #}
{# Returns the slug version of a string #}
{# Parameters #}
{# string | String to convert into a slug | Required #}
{# How to import this macro to my module #}
{# {% from '[folder]/slugify.html' import slugify %} #}
{# How to use this macro #}
<?php
return [
'&#xE84D;' => '3d_rotation',
'&#xE190;' => 'access_alarm',
'&#xE191;' => 'access_alarms',
'&#xE192;' => 'access_time',
'&#xE84E;' => 'accessibility',
'&#xE84F;' => 'account_balance',
'&#xE850;' => 'account_balance_wallet',
@reatlat
reatlat / .gitlab-ci.yml
Created May 15, 2022 01:42 — forked from swashata/.gitlab-ci.yml
Deploy WordPress Plugin with GitLab CI/CD
# Our base image
image: registry.gitlab.com/wpquark/docker-containers/php-node:2.0.0-php-7.3-node-12.13.0
# Select what we should cache
cache:
key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths:
- .yarn-cache
- .composer-cache
@reatlat
reatlat / custom-post-hierarchy.php
Created April 18, 2022 19:02 — forked from amurrell/custom-post-hierarchy.php
Allow wordpress posts to have hierarchy - figures out slugs
<?php
add_action('registered_post_type', 'make_posts_hierarchical', 99, 2);
/**
* Ensure posts post type is hierarchal and allows page attributes
*
* Initial Setup - Runs after each post type is registered
*/
function make_posts_hierarchical($post_type, $pto)
@reatlat
reatlat / free_email_provider_domains.txt
Created December 1, 2021 00:02 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@reatlat
reatlat / stateToAbbr.js
Created July 30, 2021 02:35 — forked from calebgrove/stateToAbbr.js
Convert state name to abbreviation in JavaScript. There's some better solutions in the comments, so scroll down!
// There's some better solutions in the comments, so scroll down and see how other folks have improved this!
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){