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
<?php
return [
'&#xE84D;' => '3d_rotation',
'&#xE190;' => 'access_alarm',
'&#xE191;' => 'access_alarms',
'&#xE192;' => 'access_time',
'&#xE84E;' => 'accessibility',
'&#xE84F;' => 'account_balance',
'&#xE850;' => 'account_balance_wallet',
<a href="#" onclick="download_table_as_csv('my_id_table_to_export');">Download as CSV</a>
@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){
@reatlat
reatlat / Instructions.md
Created July 18, 2021 02:02 — forked from pgilad/Instructions.md
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
function getOS() {
var userAgent = window.navigator.userAgent,
platform = window.navigator.platform,
macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],
windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
iosPlatforms = ['iPhone', 'iPad', 'iPod'],
os = null;
if (macosPlatforms.indexOf(platform) !== -1) {
os = 'macOS';
@reatlat
reatlat / git_branch.sh
Created July 4, 2021 19:17 — forked from dciccale/git_branch.sh
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
@reatlat
reatlat / monitorEvents.js
Created April 13, 2021 21:50 — forked from PaulKinlan/monitorEvents.js
monitorEvents.js
function monitorEvents(element) {
var log = function(e) { console.log(e);};
var events = [];
for(var i in element) {
if(i.startsWith("on")) events.push(i.substr(2));
}
events.forEach(function(eventName) {
element.addEventListener(eventName, log);
});