Skip to content

Instantly share code, notes, and snippets.

@robmiller
robmiller / Guardfile
Last active August 29, 2015 14:12 — forked from Integralist/Guardfile
require "terminal-notifier-guard"
guard :shell do
watch(/src\/(.*\/)?(.*)\.rs$/) do |path, folder, file|
p "Path: #{path}"
p "Folder: #{folder}"
p "File: #{file}"
binary_name = File.read("Cargo.toml")[/name = "(.*)"/, 1]

What is AOP?

Aspect Oriented Programming is a means to change the behaviour of – or add behaviour to – methods and functions (including constructors) non-invasively. The added behaviour is called “advice” and can be added before, after, or around the function it advises.

This description is similar to the Extract Surrounding refactoring method. The difference is in the direction of the change. It seems AOP is more focused at modifying existing behaviour non-invasively; where as the Extract Surrounding Method actually changes the source code to allow this type of behavioural modification.

def method_a
method_b do |thing|
thing = 'hey'
end
end
def method_b
thing = nil
thing = yield thing
@robmiller
robmiller / plugin.php
Last active December 16, 2015 00:48 — forked from joncave/plugin.php
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE