Skip to content

Instantly share code, notes, and snippets.

View rhinkle's full-sized avatar

Ryan rhinkle

  • Inspire11
  • Grand Rapids, Mi
View GitHub Profile
@rhinkle
rhinkle / node_nginx_ssl.md
Last active February 10, 2021 13:17 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@rhinkle
rhinkle / .vimrc
Created January 16, 2020 05:47
Vim RC
" Basic Setup
set nocompatible
" Set Filename in bar
set laststatus=2
set statusline+=%F
filetype indent plugin on
syntax enable
@rhinkle
rhinkle / Slide.php
Created December 11, 2015 15:15
Slide Class
<?php
/**
*
*/
class Slide
{
protected $filename_id;
protected $title;
protected $text;
@rhinkle
rhinkle / widget-include.php
Created May 13, 2015 17:22
An WordPress widget that allows users to include an html file as an widget. (ie use for signup forms)
<?php
defined( 'WPINC' ) or die;
/**
* Adds Display_Template widget.
*/
class Display_Template extends WP_Widget {
private $template_dir;
/**
* Register widget with WordPress.
@rhinkle
rhinkle / staff-custom.php
Created May 8, 2015 18:06
Fixes the template include in staff plugin.
/**
* replaces the broke function(default_staff_loop_grid_output) in staff plugin.
*
* @param (number) $id Post id.
*
* @return VOID.
*/
function custom_staff_loop_grid_output( $id ){
// Check to see if current theme has loop_grid.
if ( $overridden_template = locate_template( 'partials/staff/loop_grid.php' ) ) {
@rhinkle
rhinkle / function.php
Last active August 29, 2015 14:19
One Page Template
function get_sub_page_type(){
//use editor ?
$editor_use = get_post_meta( get_the_ID(), 'editor_use', true);
$type = $editor_use;
if($type == 'featured_image'){
$featured_image_use = get_post_meta( get_the_ID(), 'featured_image_use', true);
$type = $featured_image_use;
}
return $type;
}
jQuery(document).ready(function($){
// Uploading files
var file_frame;
$('.remove_image_button').live('click', function( event ){
event.preventDefault();
var upload_id = $( this ).data( 'upload_id' );
var upload_url = $( this ).data( 'upload_url' );
//alert(upload_id + upload_url);
$( '#' + upload_id ).attr('value',"");
@rhinkle
rhinkle / .gitignore
Last active August 29, 2015 14:17
Default Mindutopia .gitignore
*.log
*.sql
*.sublime-project
*.sublime-workspace
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
@rhinkle
rhinkle / error_log_scaner.sh
Last active August 29, 2015 14:16
search error log for "ModSecurity: Warning", cut url out the client ip address, remove trailing ], sort, remove duplicates
grep -E 'ModSecurity: Warning' error_log | cut -d' ' -f8 | sed 's/.$//' | sort | uniq -u >>
@rhinkle
rhinkle / _home.scss
Last active August 29, 2015 14:16
Bootstrap 3 carousel slider fade effect with css.
/*!
* Start Bootstrap - Full Slider HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
html,
body {
height: 100%;