Skip to content

Instantly share code, notes, and snippets.

View csdy's full-sized avatar
💵
Working on the next big thing

David Cassidy csdy

💵
Working on the next big thing
View GitHub Profile
@csdy
csdy / .htaccess
Created April 17, 2018 19:35
.htaccess Cheatsheet
<ifModule mod_rewrite.c>
# Enable mod_rewrite
RewriteEngine On
RewriteBase /
# Rewrite www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Rewrite to HTTPS
@csdy
csdy / particles.json
Created November 27, 2017 05:15
Particles.JS Snow Effect
{"particles":{"number":{"value":80,"density":{"enable":true,"value_area":800}},"color":{"value":"#ffffff"},"shape":{"type":"circle","stroke":{"width":0,"color":"#000000"},"polygon":{"nb_sides":5},"image":{"src":"img/github.svg","width":100,"height":100}},"opacity":{"value":1,"random":false,"anim":{"enable":false,"speed":1,"opacity_min":0.1,"sync":false}},"size":{"value":2,"random":true,"anim":{"enable":false,"speed":40,"size_min":0.1,"sync":false}},"line_linked":{"enable":false,"distance":150,"color":"#ffffff","opacity":0.4,"width":1},"move":{"enable":true,"speed":1,"direction":"bottom","random":false,"straight":false,"out_mode":"out","bounce":false,"attract":{"enable":false,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"canvas","events":{"onhover":{"enable":false,"mode":"repulse"},"onclick":{"enable":false,"mode":"push"},"resize":true},"modes":{"grab":{"distance":400,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"d
@csdy
csdy / check-inodes.txt
Created May 17, 2017 06:08
[cPanel] 500 Internal Server Error - The system failed to open the session file
# Check Inode Usage
cd / && echo "Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
# Out of Inodes? Purge Comet Files!
/usr/local/cpanel/bin/purge_dead_comet_files
@csdy
csdy / backup.bat
Created April 7, 2017 09:37
Windows MariaDB Backup + ZIP + Prune
@echo off
CLS
cd C:\Windows\Temp
set MYSQLUSER=root
set MYSQLPASS=**********
set BATCHFILE=C:\Windows\Temp\Batch_mysqldump.bat
set DUMPPATH=C:\Windows\Temp
SET backuptime=%DATE:~4,2%-%DATE:~7,2%-%DATE:~10,4%-%TIME:~0,2%-%TIME:~3,2%
SET backuptimelog=%DATE:~4,2%-%DATE:~7,2%-%DATE:~10,4% %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo starting MySqlDump at %backuptime%
@csdy
csdy / scan.sh
Created March 26, 2017 07:53
cPanel - Manual Clam Scan
cd /usr/local/cpanel/3rdparty/bin/ && ./clamscan -r /home | grep FOUND >> /home/FOUND.txt
@csdy
csdy / gulpfile.js
Last active May 8, 2017 03:45
Gulp
// DEPENDENCIES
var autoprefixer = require('gulp-autoprefixer');
var chalk = require('chalk');
var concat = require('gulp-concat');
var debug = require('gulp-debug');
var gulp = require('gulp');
var gutil = require('gulp-util');
var imagemin = require('gulp-imagemin');
var jshint = require('gulp-jshint');
@csdy
csdy / .scss-lint.yml
Created October 31, 2016 01:08
SCSS Lint Configuration
# Lint these files
scss_files:
- "./assets/**/*.scss"
# Exclude these files
# exclude:
# Plugin directories
# plugin_directories: []
@csdy
csdy / README.md
Created October 26, 2016 07:10
NGINX - HTML as PHP

NGINX - HTML as PHP

To enable the parsing of HTML files as PHP in NGINX, use the following instructions. If you are not using Vagrant/Homestead skip to step four.

  1. Open a new terminal window
  2. SSH into the virtual machine
    cd ~/homestead/ && vagrant ssh
    
  3. Edit the site configuration (replace example.com with your domain name)
@csdy
csdy / tsconfig.json
Created June 10, 2016 07:56
TypeScript Configuration
{
"compilerOptions": {
"target": "es5"
}
}
@csdy
csdy / BASE_Controller.php
Last active May 8, 2016 16:11
CodeIgniter Base Code
<?php
/**
* Base Controller
*
* @author David Cassidy <[email protected]>
* @copyright Copyright (c) 2016, David Cassidy. Some rights reserved.
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
// Security check