Skip to content

Instantly share code, notes, and snippets.

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

David Lonjon davidlonjon

🏠
Working from home
View GitHub Profile
@davidlonjon
davidlonjon / gdown.pl
Created November 10, 2016 12:09
Google Drive download Perl script
#!/usr/bin/perl
#
# Google Drive direct download of big files
# ./gdown.pl 'gdrive file url' ['desired file name']
#
# v1.0 by circulosmeos 04-2014.
# http://circulosmeos.wordpress.com/2014/04/12/google-drive-direct-download-of-big-files
#
use strict;
@davidlonjon
davidlonjon / nohup-output-to-file.sh
Created September 26, 2016 05:55 — forked from umidjons/nohup-output-to-file.sh
Redirect nohup output to a file
# redirect output and errors into file output.log:
nohup some_command > output.log 2>&1&
# abbreviated syntax for bash version >= ver.4:
nohup some_command &> output.log
@davidlonjon
davidlonjon / .editorconfig
Created September 25, 2016 08:57
.editorconfig for WordPress
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<rule ref="WordPress-Core" />
<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra" />
<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
<severity>0</severity>
@davidlonjon
davidlonjon / phpunit.xml
Created September 18, 2016 09:57
PHPunit config file for WordPress plugin
<phpunit
bootstrap="phpunit-plugin-bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<php>
<const name="WP_TEST_VIP_QUICKSTART_ACTIVATED_PLUGINS" value="jetpack/jetpack.php,media-explorer/media-explorer.php,writing-helper/writing-helper.php,mrss/mrss.php,wordpress-importer/wordpress-importer.php,keyring/keyring.php,polldaddy/polldaddy.php" />
@davidlonjon
davidlonjon / phpunit-plugin-bootstrap.php
Created September 18, 2016 09:54
PHPunit Bootstrap for WordPress plugin
<?php
// Determine if we should update the content and plugin paths.
if ( file_exists( dirname( __DIR__ ) . '/wp-load.php' ) ) {
define( 'WP_CONTENT_DIR', dirname( __DIR__ ) . '/wp-content/' );
} else if ( file_exists( '../../../wp-content' ) ) {
define( 'WP_CONTENT_DIR', dirname( dirname( dirname( getcwd() ) ) ) . '/wp-content/' );
}
if ( defined( 'WP_CONTENT_DIR' ) && ! defined( 'WP_PLUGIN_DIR' ) ) {
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . 'plugins/' );
}
@davidlonjon
davidlonjon / Documentation.md
Created April 24, 2016 13:19 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@davidlonjon
davidlonjon / gist:3771485984b799045b43
Created March 11, 2016 07:40 — forked from ssx/gist:2649191
WordPress: WP_Query $args Ultimate Reference
<?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(
@davidlonjon
davidlonjon / pedantically_commented_playbook.yml
Created January 12, 2016 12:26 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@davidlonjon
davidlonjon / pricing.txt
Created November 27, 2015 08:17 — forked from thbkrkr/pricing.txt
Amazon AWS vs Google Compute Engine (GCE) vs DigitalOcean vs OVH RunAbove
------------
Amazon (http://calculator.s3.amazonaws.com/index.html)
------------
type price CPU RAM Disk I/O EBS opt.
t2.micro 10$ 1 1.0 -- Low --
t1.micro 15$ 1 0.6 -- Very Low --
t2.small 10$ 1 2.0 -- Low --
m1.small 34$ 1 1.7 1 x 160 Low --
t2.medium 41$ 2 4.0 -- Low --
m3.medium 56$ 1 3.7 SSD 1 x 4 Moderate --