Skip to content

Instantly share code, notes, and snippets.

View OrderAndCh4oS's full-sized avatar
🕰️
Writing code

Sean Cooper OrderAndCh4oS

🕰️
Writing code
View GitHub Profile
<?php
global $wpdb;
/**
* and all the original post data then
*/
$post = get_post($post_id);
/**
@OrderAndCh4oS
OrderAndCh4oS / Gruntfile.js
Created May 10, 2017 14:10
Grunt Setup for SASS and JS
module.exports = function (grunt) {
// This banner gets inserted at the top of the generated files, such a minified CSS
var bannerContent = '/*!\n' +
' * <%= pkg.name %>\n' +
' * Version: <%= pkg.version %>\n' +
' * Build date: <%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %>\n' +
' */\n\n';
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
@OrderAndCh4oS
OrderAndCh4oS / .gitignore
Created May 10, 2017 14:13
Wordpress Gitignore
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
@OrderAndCh4oS
OrderAndCh4oS / .sh_image_functions
Last active August 2, 2019 07:12
ImageMagick Bash Scripts
# flatColourConvert image.png red
function flatColourConvert() {
magick convert "$1" -fill "$2" -colorize 100% x.png
}
# replaceColours "#1B3057" "#2B373D"
# replaceColours red "#2B373D" 70%
function replaceColours() {
magick convert *.png -set filenam
@OrderAndCh4oS
OrderAndCh4oS / package.json
Created January 4, 2018 11:22
Webpack Simple ES6 + Lodash
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
@OrderAndCh4oS
OrderAndCh4oS / .htaccess
Last active May 27, 2018 08:47
GDPR Solved
MaxMindDBEnable On
MaxMindDBFile DB /opt/GeoIP/GeoLite2-Country.mmdb
MaxMindDBEnv MM_COUNTRY_CODE DB/country/iso_code
SetEnvIf MM_COUNTRY_CODE ^(AT|BE|BG|HR|CY|CZ|DK|EE|FI|FR|DE|GR|HU|IE|IT|LV|LT|LU|MT|NL|PL|PT|RO|SK|SI|ES|SE|GB|GI|AX|PM|GL|BL|SX|AW|CW|WF|PF|NC|TF|AI|BM|IO|VG|KY|FK|MS|PN|SH|GS|TC|IS|LI|NO|EU) BlockCountry
Deny from env=BlockCountry
@OrderAndCh4oS
OrderAndCh4oS / validation.py
Created August 2, 2018 17:09
Python Chain of Commandesque Validation System
class Validator():
def __init__(self):
self.valid = False
self.validation_links = []
self.error_message = None
def is_valid(self):
return self.valid
def set_valid(self, is_valid):
set nocompatible
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
let g:ycm_confirm_extra_conf = 0
Plugin 'VundleVim/Vundle.vim'
Plugin 'fugitive.vim'
@OrderAndCh4oS
OrderAndCh4oS / generate_secret
Created December 23, 2018 23:31
Terminal Generate Secret Key
function secret() {
</dev/urandom tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 32 ; echo
}
@OrderAndCh4oS
OrderAndCh4oS / CSVDownload.php
Last active January 12, 2019 00:27
CSV Download
<?php
/**
* Class CSVDownload
*/
class CSVDownload {
/**
* @var array
*/