Skip to content

Instantly share code, notes, and snippets.

View nfsarmento's full-sized avatar

NS nfsarmento

View GitHub Profile
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active May 3, 2024 12:07
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@matthewoden
matthewoden / AWS Git Setup.md
Created May 22, 2016 17:48
Setting up a remote Git in AWS EC2

AWS Remote Git Setup

Get a local git repo up on an EC2 Instance.

Add youself to SSH Authentication:

Add yourself to the ssh auth agent, if you haven't already.

ssh-add path/to/your/EC2.pem

Set up destination directory:

@jfreites
jfreites / memp_setup.md
Last active August 9, 2023 09:27
MEMP Stack: setup Nginx, PHP and MySQL on Mac

Setup a MEMP Stack

MacOSX + Nginx + MySQL + PHP. Tested with El Capitan

Install Homebrew:

run on terminal:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew doctor
@trslater
trslater / custom-registration.php
Last active May 12, 2020 13:47
Custom Registration Plugin
<?php
/*
Plugin Name: Custom Registration
Description: Updates user rating based on number of posts.
Version: 1.1
Author: Tristan Slater w/ Agbonghama Collins
Author URI: http://kanso.ca
*/
@cristianstan
cristianstan / Simple Ajax Login Form.php
Last active October 12, 2023 00:09
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
@jplhomer
jplhomer / page-about.php
Created October 25, 2013 03:46
The template to show our custom timeline using Wordpress and Advanced Custom Fields: http://jplhomer.org/2013/10/building-responsive-timeline-advanced-custom-fields/
<?php if ( $events = get_field( 'events' ) ) :
// Re-order our events just in case
if ( get_field('sort_order') == 'Date Descending') {
usort( $events, 'sort_by_date_descending');
} else {
usort( $events, 'sort_by_date_ascending');
}
// Set a year checker to see if we should print a new year
$year = 0;