Skip to content

Instantly share code, notes, and snippets.

View anithegregorian's full-sized avatar
🏠
Working from home

Anirudh K Mahant anithegregorian

🏠
Working from home
View GitHub Profile
@anithegregorian
anithegregorian / download-live-site.sh
Last active September 11, 2015 09:37
Bash: Download MySQL database & files to from live to development server
#!/bin/bash
#===============================================================================
# This is a template for a script I use on a lot of sites to copy the database
# (MySQL) and any uploaded files to the development site, and modify the
# database as required.
#
# The script should be on the development server. The live site can either be on
# the same server, or a remote server connected via SSH.
#
@anithegregorian
anithegregorian / gist:6aa3a5c2a448c3386b2d
Last active September 17, 2015 09:54 — forked from billerickson/gist:3698476
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@anithegregorian
anithegregorian / lamp-stack-osx-virtualhostx.md
Created July 12, 2016 19:37 — forked from pwenzel/lamp-stack-osx-virtualhostx.md
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@anithegregorian
anithegregorian / Slimdown.md
Created January 22, 2017 16:06 — forked from jbroadway/Slimdown.md
Slimdown - A simple regex-based Markdown parser.

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore
.idea
./npm_modules
### Windows template
# Windows thumbnail cache files
zend_extension = "xdebug.so"
; -----------------------------------------------------------------------------
; xdebug.auto_trace
;
; Type: boolean, Default value: 0
;
; When this setting is set to on, the tracing of function calls will be enabled
; just before the script is run. This makes it possible to trace code in the
; auto_prepend_file [1].
#!/bin/bash
######################################################################
# Script to install Greenbone/OpenVAS on Ubuntu 20.04
#
# Note: run as root
#
# Usage: sudo ./install_gvm.sh
#
# Based on:
# https://kifarunix.com/install-and-setup-gvm-11-on-ubuntu-20-04/?amp
@anithegregorian
anithegregorian / endpoints.php
Created January 27, 2021 14:11 — forked from joncave/endpoints.php
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
@anithegregorian
anithegregorian / exemplifi_contentful_nuxt_config.js
Last active February 22, 2021 16:57
Contentful plugin configuration in NuxtJS
/* eslint eol-last: ["error", "always"] */
const contentful = require('contentful')
// Those are set via `env` property in nuxt.config.js or environment variables
const config = {
space: process.env.NUXT_ENV_CONTENTFUL_SPACE,
accessToken: process.env.NUXT_ENV_CONTENTFUL_ACCESS_TOKEN
}
// CSS VARIABLES
:root {
--body-font-family: #{$site-body-font-family};
--heading-font-family: #{$site-heading-font-family};
--heading-font-weight: 500;
// Scale factors
@each $factor, $value in $scale-factors {
--scale-factor-#{$factor}: #{$value};
}