Skip to content

Instantly share code, notes, and snippets.

View miklb's full-sized avatar
🎣
Gone Fishing

Michael Bishop miklb

🎣
Gone Fishing
View GitHub Profile
@rosemulazada
rosemulazada / script.js
Last active April 7, 2024 05:32
SCALABLE: Save form data to localStorage and auto-complete on refresh
// With the help of Jeremy Keith, I was able to create a fully scalable code sample that you can copy-paste into your project.
// It will save the user input value on blur, this includes radio buttons, checkboxes and date inputs besides regular text/number inputs.
// The only condition is that you give the form element on your page a data-attribute of data-form-topic="foo".
// This code snippet saves the data-attribute as the key to the localStorage, and the value of it will be an object with key/value pairs of the respective inputs name and value.
// Please refer to this gist somewhere in your code if you use it :)
// Happy coding!
// VARIABLE DECLARATIONS
// objects
let savedData = {};
# To prevent the vulnerable server from running on your machine
# (this does not impact Zoom functionality), run these two lines in your Terminal.
pkill "ZoomOpener"; rm -rf ~/.zoomus; touch ~/.zoomus && chmod 000 ~/.zoomus;
pkill "RingCentralOpener"; rm -rf ~/.ringcentralopener; touch ~/.ringcentralopener && chmod 000 ~/.ringcentralopener;
# (You may need to run these lines for each user on your machine.)
@theecrit
theecrit / readme.md
Last active January 21, 2024 16:59
Docs For Alignment: ReadMe Template

Project title and description

Include a project description that explains what your project is and why it exists. Aim for no more than 3-5 concise sentences. For example, you might say:

{Project Name} is a project of {Your Brigade}. {Your Brigade} is a brigade of a Code for America that exists to {your mission}. {Project Name} helps {target users} accomplish {goal of project}. The {app/site/thing you're building}'s main features include {very brief feature descriptions}.

Project context

Civic projects often exist within a larger context that may include multiple stakeholders, historic relationships, associated research, or other details that are relevant but not required for direct contributions. Gathering these details in one place is useful, but the ReadMe isn't that place. Use this section to link to a Google Doc or other documentation repository where contributors can dig in if they so choose. This is also a good place to link to your Code of Conduct.

@gRegorLove
gRegorLove / functions.php
Last active April 2, 2018 02:21
WordPress filter to approve webmentions from previously-approved domains
<?php
if ( !function_exists('indieweb_check_webmention') ) {
/**
* Using the webmention_source_url, approve webmentions that have been received from previously-
* approved domains. For example, once you approve a webmention from http://example.com/post,
* future webmentions from http://example.com will be automatically approved.
* Recommend placing in your theme's functions.php
*
@petermolnar
petermolnar / wp-cron
Last active January 5, 2018 10:42
cron file for wordpress backup and wp-cron using wp-cli
MAILTO="you@domain.com"
SHELL=/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
# prerequisities:
# sudo wget -q -O/usr/local/bin/wpcli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; sudo chmod 0755 /usr/local/bin/wpcli
# WP CRON
* * * * * wpuser cd /path/to/wordpress; wpcli cron event run --due-now --quiet
@ttscoff
ttscoff / changelog.rb
Created August 13, 2017 22:28
Generate release notes from git commit messages
#!/usr/bin/ruby
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged release
# where commit messages contain NEW, FIXED, and IMPROVED keywords and sort and fromat
# them into a Markdown release note list.
#
# The script takes version information from the macOS command agvtool and bases
# the product name on the first matching Xcode Info.plist found
@iuliaL
iuliaL / _new_mixins.sass
Last active February 21, 2017 13:03
New mixins partial, added Hamburger animation mixin and some other cool reusable stuff
.full-height
height: 100%
.inline-block
display: inline-block
.block
display: block
=uppercase
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active April 25, 2021 02:17
Loop through Jekyll collections and output their content as sections and articles
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@chrismccoy
chrismccoy / restapi.txt
Last active March 30, 2024 08:17
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js