Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create addtabindex.js #1

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
691ef96
Create addtabindex.js
sueb226 May 18, 2020
434ae9a
Update README.md
sueb226 May 18, 2020
94c168e
Create useful_sites.md
sueb226 May 18, 2020
53ab1f7
Update useful_sites.md
sueb226 May 18, 2020
ac4a54c
Update README.md
sueb226 May 18, 2020
4277da8
Create useful_links.md
sueb226 May 18, 2020
cf3f06c
Rename useful_links.md to readme.md
sueb226 May 18, 2020
c5e3dd7
Rename useful_sites.md to readme.md
sueb226 May 18, 2020
5208755
Create readme.md
sueb226 May 19, 2020
97d8faf
Update readme.md
sueb226 May 19, 2020
e2991c0
Update readme.md
sueb226 May 19, 2020
0a0b233
Update readme.md
sueb226 May 19, 2020
7af8219
Create readme.md
sueb226 May 19, 2020
b146d58
Create readme.md
sueb226 May 19, 2020
12ca663
Update readme.md
sueb226 May 19, 2020
314df3e
Create readme.md
sueb226 May 19, 2020
6ea289b
Update readme.md
sueb226 May 19, 2020
8805613
Create shortcode-table-example.txt
sueb226 Oct 7, 2021
c89869e
Create update-network.txt
sueb226 Oct 12, 2021
1410922
Create S3.md
sueb226 Nov 17, 2021
5a3518b
Update S3.md
sueb226 Nov 17, 2021
02bb7d4
Update S3.md
sueb226 Nov 17, 2021
798d9b3
Update S3.md
sueb226 Nov 18, 2021
5f80093
Create thumbnail-manipulation.txt
sueb226 Dec 13, 2021
96426c8
Create count-content-by-year.sql
sueb226 Dec 14, 2021
dbc9807
Update count-content-by-year.sql
sueb226 Dec 14, 2021
5f4703d
Created Page
sueb226 Apr 26, 2022
3359280
Create List-posts-by-type-display-last-editor.sql
sueb226 Jul 14, 2022
0eab2be
Create readme.md
gsdwebstaff Sep 19, 2022
9cc12a6
Merge pull request #2 from gsdwebstaff/patch-1
sueb226 Sep 19, 2022
21f840a
Update readme.md
sueb226 Sep 19, 2022
eb6d353
Update readme.md
sueb226 Sep 19, 2022
8d5f6c1
Update S3.md
sueb226 Sep 19, 2022
40d5f08
Update S3.md
sueb226 Sep 19, 2022
7ee7df9
Update readme.md
sueb226 Sep 19, 2022
a1210e4
Update readme.md
sueb226 Sep 19, 2022
03cc3a8
Update readme.md
sueb226 Sep 19, 2022
b415aba
Update S3.md
sueb226 Sep 19, 2022
257bd5a
Update S3.md
sueb226 Sep 19, 2022
482525d
Update S3.md
sueb226 Sep 19, 2022
0beb0b5
Create users.md
sueb226 Nov 15, 2022
ab38c11
Rename update-network.txt to update-network.md
sueb226 Nov 15, 2022
7060271
Update update-network.md
sueb226 Nov 15, 2022
6eeac0c
Update update-network.md
sueb226 Nov 15, 2022
c6db9a1
Create post_content_author_editor.sql
sueb226 Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# useful-snippets
# Useful Snippets
Just bits of code I may want to use again

# Useful Links
## Wikis
https://www.markdownguide.org/basic-syntax/#headings
6 changes: 6 additions & 0 deletions accessibility/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Useful Links

## Guides
- [Harvard's Web Accessibilty Site](https://accessibility.huit.harvard.edu)
- [Yale's Web Accessibilty Site](https://usability.yale.edu/web-accessibility/)
- [WebAim](https://webaim.org)
25 changes: 25 additions & 0 deletions cli/aws/S3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# AWS CLI

- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)
- [Installing AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- [AWS - Step 2: Create an IAM user account](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-prereqs.html#getting-started-prereqs-iam)
- [AWS - Step 3: Create an access key ID and secret access key](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-prereqs.html#getting-started-prereqs-keys)

## Copying down to local machine
We off load wp-content/uploads to AWS using WPEngine's LargeFS
Sometimes we create a clone of a server for development and need to also copy the images
[AWS's documentation ](https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html)


- Create a directory to store the files `mkdir s3-files`
- Navigate to that directory


### AWS Directory to your current directory
>$ aws s3 cp s3://bucket/folder/ . --recursive

## AWS Genrate a list of bucket contents
>$ aws s3 ls s3://bucket/ > blockcontents.txt

## AWS Move File matching pattern to subdirectory
>$ aws s3 mv s3://bucket/ s3://bucket/directory/ --exclude "*" --include "filename-\*"
9 changes: 9 additions & 0 deletions cli/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Misc CLI commands

## Remove files in directory
> rm file-name-*

## When rm file-name-* times out
> for f in filename-*; do rm "$f"; done
### Output filenames as they are deleted
>for f in filename-*; do echo rm "$f"; rm "$f"; done
1 change: 1 addition & 0 deletions cli/regex/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stuff and things
12 changes: 12 additions & 0 deletions js/addtabindex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Add HTML attribute tabindex="0" to element with .CLASS_NAME
* @see - https://api.jquery.com/attr/
* @see - https://api.jquery.com/jQuery.noConflict/
*/

jQuery(document).ready(function ($) {
$('.CLASS_NAME').each(function() {
var $element = $(this);
$element.attr("tabindex", "0");
});
});
1 change: 1 addition & 0 deletions js/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions wp/CAS/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CAS Authentication

## Useful plugins
- [College of Education, University of Hawaii at Manoa' Authorizer Plugin](https://github.com/uhm-coe/authorizer/)
* [WordPress Plugin Page for Authorizer]( https://wordpress.org/plugins/authorizer/)
- WPCassify
3 changes: 3 additions & 0 deletions wp/cli/thumbnail-manipulation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://developer.wordpress.org/cli/commands/media/regenerate/
# Re-generate only the thumbnails of "large" image size for all images.
$ wp media regenerate --image_size=large
8 changes: 8 additions & 0 deletions wp/cli/update-network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# WP Core
## force update or downgrade to a specific release
- [wp core update](https://developer.wordpress.org/cli/commands/core/update/)
> wp core update --version=x.x --force

## Update database after core update
- [wp core update-db](https://developer.wordpress.org/cli/commands/core/update-db/)
> wp core update-db --network
13 changes: 13 additions & 0 deletions wp/cli/users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# WP-CLI Commands

## WP User

- [User Commands](https://developer.wordpress.org/cli/commands/user/)
- [wp user list](https://developer.wordpress.org/cli/commands/user/list/)
- [wp user update **user_id** --user_pass=**password_string**](https://developer.wordpress.org/cli/commands/user/update/)

## WP Network Super Admins

- [Super Admin Commands](https://developer.wordpress.org/cli/commands/super-admin/)
- [wp super-admin list](https://developer.wordpress.org/cli/commands/super-admin/list/)
- [wp super-admin **add user_id**||**user_name**](https://developer.wordpress.org/cli/commands/super-admin/add/)
1 change: 1 addition & 0 deletions wp/multisite/recreate-deleted-subsite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

10 changes: 10 additions & 0 deletions wp/plugins/plugins-list/shortcode-table-example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<figure class="wp-block-table is-style-stripes">
<table>
<thead>
<tr>
<th scope="col">Plugin</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
[plugins_list cache=60 format="<tr><td>{{LinkedTitle}} <br/> by: {{LinkedAuthor}}</td> <td>{{Description}}</td></tr>"]</tbody><tfoot><tr><th scope="col">Plugin</th><th scope="col">Description</th> </tr></tfoot></table></figure>
7 changes: 7 additions & 0 deletions wp/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Useful Wordpress Links

## Customizer
- 2017 [Madison Designs - Customizer Developer Guide](https://maddisondesigns.com/2017/05/the-wordpress-customizer-a-developers-guide-part-1/)

## Widgets
- [WordPress Developer Documentation Widgets](https://developer.wordpress.org/themes/functionality/widgets/)
20 changes: 20 additions & 0 deletions wp/sql/List-posts-by-type-display-last-editor.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SELECT
wp_posts.post_date AS 'Post Date',
wp_posts.post_modified AS 'Post Modified',
wp_posts.post_title AS ' Post Title',
wp_posts.post_type AS 'Post Type',
wp_posts.post_parent AS 'Post parent id',
wp_posts.guid AS 'GUID',
author.user_email AS 'Author Email',
author.display_name AS 'Author Display Name',
editor.user_email AS 'Editor Email',
editor.display_name AS 'Editor Display Name'
FROM wp_posts, wp_postmeta, wp_users author, wp_users editor
WHERE wp_posts.post_type IN ('page','post','attachment')
AND wp_posts.post_status in ( 'publish', 'draft','private' )
AND wp_posts.post_author = author.id
AND ( wp_postmeta.post_id = wp_posts.id
AND wp_postmeta.meta_key LIKE '%_edit_last%'
AND wp_postmeta.meta_value = editor.id
)
ORDER BY wp_posts.post_type ASC, wp_posts.post_modified DESC
8 changes: 8 additions & 0 deletions wp/sql/count-content-by-year.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Source: https://wordpress.stackexchange.com/questions/178816/count-posts-for-each-year

SELECT YEAR(post_date) AS `year`, count(ID) as `content count`
FROM wp_posts
WHERE post_type IN ('attachment', 'post', 'page', 'my-custom-post-type')
AND post_status IN ('publish')
GROUP BY YEAR(post_date)
ORDER BY post_date DESC
22 changes: 22 additions & 0 deletions wp/sql/post_content_author_editor.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SELECT
p.ID AS 'PostID',
p.post_type AS 'Post Type',
p.post_title AS ' Post Title',
p.post_status AS 'Post Status',
p.post_parent AS 'Post Parent ID',
p.guid AS 'GUID',
p.post_content AS 'Post Content',
p.post_date AS 'Post Date',
author.user_email AS 'Author Email',
author.display_name AS 'Author Display Name',
p.post_modified AS 'Post Modified',
editor.user_email AS 'Editor Email',
editor.display_name AS 'Editor Display Name'
FROM wp_posts p , wp_postmeta pm, wp_users author, wp_users editor
WHERE p.post_status in ( 'publish', 'draft','private' )
AND p.post_author = author.id
AND ( pm.post_id = p.id
AND pm.meta_key LIKE '%_edit_last%'
AND pm.meta_value = editor.id
)
ORDER BY p.post_status DESC, p.post_modified DESC
2 changes: 2 additions & 0 deletions wp/widgets/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#