Skip to content

Instantly share code, notes, and snippets.

View Japh's full-sized avatar

Japh Japh

View GitHub Profile

I thought it would be pertinent to respond to some points presented by Andrey "Rarst" Savchenko in recent post Progressive Enhancement.

Progressive Enhancement

Unlike Rarst, I don't value progressive enhancement very highly and don't agree it's a fundamental principle of the web that should be universally employed. Quite frankly, I don't care about not supporting JavaScript, and neither does virtually anyone else. It's not that it doesn't have any value, or utility - but in a world where we don't have unlimited resources and time, one has to prioritise what we'll support and not support.

I'm a proponent of putting my ideas and creations into the world for people to make use of; and if I had to cover 100% of use cases for doing that, I wouldn't put much out there. I'm fine with losing the 1.1% of

@maddisondesigns
maddisondesigns / functions.php
Last active January 1, 2019 11:07
Remove Yoast SEO nag after update
<?php
/*
* Remove the annoying Yoast SEO nag for all Admin Users. Tested with v3.4.2
*/
class ahRemoveYoastNag_Remove_Yoast_SEO_Nag {
private $yoastPluginFile;
public function __construct() {
$this->yoastPluginFile = "wordpress-seo/wp-seo.php";
register_activation_hook( $this->yoastPluginFile, array( $this, 'ryn_remove_yoast_nag_on_activation' ) );
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@markjaquith
markjaquith / aaa.nginxconf
Last active February 1, 2017 04:30
Grab non-locally-existing production images from Photon for your local WordPress dev environment
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
<?php
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
FacebookSession::setDefaultApplication('YOUR_APP_ID','YOUR_APP_SECRET');
// Use one of the helper classes to get a FacebookSession object.
// FacebookRedirectLoginHelper
@tcrsavage
tcrsavage / gist:e61fa2cf1a458671b4bc
Last active August 29, 2015 14:14
WorddPress Self unhooking nested anonymous function
//Ensure that we don't allow creation of tickers via insertion of a post with non-existent tickers assigned
//Tickers should only be created via the admin ticker interface or via automatic pull-in from xignite
add_filter( 'wp_insert_post_data', function( $data, $post_arr ) {
if ( empty( $post_arr['tax_input']['ticker'] ) ) {
return $data;
}
$created_tickers = array();
@mingfang
mingfang / convert id_rsa to pem
Last active March 3, 2024 08:46
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
<!DOCTYPE HTML>
<html>
<head>
<title>T11</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #000000;
@richardtape
richardtape / subdir-loader.php
Created August 23, 2014 01:35
Allow WordPress-MU plugins to be loaded automatically from a sub directory
<?php
/**
* Plugin Name: MU plugins subdirectory loader
* Plugin URI: http://code.ctlt.ubc.ca
* Description: Enables the loading of plugins sitting in mu-plugins (as folders)
* Version: 0.1
* Author: iamfriendly, CTLT
* Author URI: http://ubc.ca/
*
@RichardBronosky
RichardBronosky / multiple_ssh_setting.md
Last active May 13, 2023 09:28 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"