Skip to content

Instantly share code, notes, and snippets.

View NichlasB's full-sized avatar

Nichlas Brandon NichlasB

View GitHub Profile
@NichlasB
NichlasB / sftp-new-server.sh
Last active June 17, 2020 14:48
Shell Script for Setting Up SFTP Server with EasyEngine
#!/bin/bash
# WARNING: Only run this script once per server.
####
## Creating SFTP Users - Initial Setup for New Server
####
####
## Gist: https://gist.github.com/NichlasB/e938cddb7876fd74af09dc00ca537a2c
@NichlasB
NichlasB / google-analytics-tracking-template.php
Last active April 22, 2019 10:01
Template for adding Google Analytics tracking code to site's head.
<?php
/* Copy the Content Below this line - DO NOT INCLUDE THE <?php ABOVE */
/**
* Add Google Analytics tracking code
*/
function cf_google_analytics_tracking() { ?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@NichlasB
NichlasB / obscure-login-error-messages.php
Last active June 22, 2017 21:44
Obscure WordPress Login Error Message
<?php
/* Copy the Content Below this line - DO NOT INCLUDE THE <?php ABOVE */
function cf_login_obscure() {
return "Something didn't work out right!";
}
add_filter( 'login_errors', 'cf_login_obscure' );
@NichlasB
NichlasB / smoothscrollanchors-staticmobile.js
Last active July 15, 2017 19:04
Smooth Scroll Anchors (w/ Static Mobile NavBars/Headers)
jQuery(document).ready(function ($) {
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
/* Smooth Scroll Anchor Links */
$(document).on('click', 'a[href*="#"]', function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
@NichlasB
NichlasB / smoothscrollanchors.js
Last active July 15, 2017 19:03
Smooth Scroll Anchors (w/ Fixed Mobile NavBars/Headers)
jQuery(document).ready(function($){
/* Smooth Scroll Anchor Links */
$(document).on('click', 'a[href*="#"]', function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
$('html, body').stop().animate({