Skip to content

Instantly share code, notes, and snippets.

@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@jwilson8767
jwilson8767 / es6-element-ready.js
Last active April 22, 2024 20:28
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@technosailor
technosailor / check-plugin-vuln.sh
Created November 23, 2016 20:18
Check all plugins for vulnerabilities via wp-vulnerability-scanner. Requires WP-CLI.
for plugin in `wp plugin list --format=csv | cut -d , -f 1`;
do
wp vuln plugin-check $plugin;
done
@chrisdc
chrisdc / .jscsrc
Last active November 2, 2018 19:48
Options file for JSCS
{
"disallowKeywordsOnNewLine": ["else"],
"disallowMixedSpacesAndTabs": "smart",
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowTrailingWhitespace": true,
"requireBlocksOnNewline": true,
@jonathantneal
jonathantneal / README.md
Last active August 29, 2015 14:12
Handy GIT ZSH shortcuts

Handy GIT ZSH shortcuts

Here are some handy git shortcuts I use with oh-my-zsh to both speed up and protect my workflow.

All merges are handled without a fast-forward. All merges use the default messaging. Whenever possible, autocompletion is provided.

gmto

Merges the current branch into another branch and prompts you to automatically push changes.

@westonruter
westonruter / README
Last active September 1, 2021 18:16
Moved to https://github.com/xwp/vip-quickstart/pull/3
@adamsilverstein
adamsilverstein / expanded_alowed_tags
Last active April 3, 2024 18:15
WordPress expanded allowed tags for wp_kses with iframe, forms, etc.
function expanded_alowed_tags() {
$my_allowed = wp_kses_allowed_html( 'post' );
// iframe
$my_allowed['iframe'] = array(
'src' => array(),
'height' => array(),
'width' => array(),
'frameborder' => array(),
'allowfullscreen' => array(),
);
@wturrell
wturrell / popular-posts.php
Created March 14, 2014 12:33
Wordpress & Google Analytics - retrieve most popular posts
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ChrisMcKee
ChrisMcKee / php-md5-hash-in-c#
Created January 4, 2013 13:49
PHP MD5 Hash in C# Most implementations of the PHP md5() function in C# produce a different result; this produces the correct one.
public static string PHPMd5Hash(string pass)
{
using (MD5 md5 = MD5.Create())
{
byte[] input = Encoding.UTF8.GetBytes(pass);
byte[] hash = md5.ComputeHash(input);
return BitConverter.ToString(hash).Replace("-", "");
}
}