Skip to content

Instantly share code, notes, and snippets.

@mmcachran
mmcachran / gist:fa8b635514fb3f0cd4dd759065b75e84
Created October 29, 2023 00:48 — forked from alexyvassili/gist:ff201b5aa4e6401c9db0e81ab1d22822
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@mmcachran
mmcachran / roblox.sh
Created October 29, 2023 00:48 — forked from killertofus/roblox.sh
roblox installer
#!/usr/bin/env bash
echo "Roblox Installer by blan.ks"
echo "Before the installation continues I heavily encourage you to read through the script and ensure it is not malicious"
sleep 6
#Checks if their cpu supports required features for Hyperion anti-cheat
if lscpu | grep -o "avx" 1>/dev/null || \
echo "Sadly your computer is too old to play ROBLOX! With the release of Hyperion/Byfron anticheat brought requirements that your computer does not meet. (Missing AVX)" && exit
which flatpak || \
echo "flatpak is missing and is required for this script. installing it for you." && sudo apt install flatpak
@mmcachran
mmcachran / css-units-best-practices.md
Created September 21, 2023 12:40 — forked from basham/css-units-best-practices.md
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@mmcachran
mmcachran / npm-scripts-for-docker.md
Created April 10, 2023 17:56 — forked from duluca/npm-scripts-for-docker.md
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@mmcachran
mmcachran / script-template.sh
Created February 10, 2023 17:45 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
---
# Page meta info, like heading, footer text and nav links
pageInfo:
title: Dashy
description: Welcome to your new dashboard!
navLinks:
- title: GitHub
path: https://github.com/Lissy93/dashy
- title: Documentation
path: https://dashy.to/docs
@mmcachran
mmcachran / mysql_backup.sh
Created August 28, 2020 18:32 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@mmcachran
mmcachran / gist:d5492419516c65212308
Created March 17, 2016 13:43 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@mmcachran
mmcachran / gist:4104bf7f2917b9617f50
Last active January 12, 2021 13:12
ElasticSearch Notes
== VM for local dev ==
https://github.com/mmcachran/vagrant-elasticsearch-cluster
Add to WP config or in EP settings:
define( 'EP_HOST', 'http://10.0.0.11:9200' );
Indexing your local
wp elasticpress index --setup --network-wide
== To index large multinetwork sites ==
@mmcachran
mmcachran / gist:052a24dd3d1465e58f7a
Last active August 29, 2015 14:21
Get posts by taxonomy
SELECT DISTINCT
post_title,
post_type,
wp_terms.*
FROM wp_posts
LEFT JOIN wp_postmeta
ON(wp_posts.id = wp_postmeta.post_id)
LEFT JOIN wp_term_relationships
ON(wp_posts.id = wp_term_relationships.object_id)
INNER JOIN wp_term_taxonomy