Instantly share code, notes, and snippets.

@JWardee
JWardee / payload.txt
Created Dec 8, 2018
Hak5 Rubber Ducky USB payload for Windows that opens notepad says hello
View payload.txt
DELAY 1000
GUI r
DELAY 500
STRING notepad.exe
ENTER
DELAY 500
STRING James says hello!
@JWardee
JWardee / payload.txt
Created Dec 8, 2018
Hak5 Rubber Ducky USB payload for OSX that forces the volume to maximum and opens a YouTube video every 2 minutes
View payload.txt
DEFAULTDELAY 250
DELAY 750
GUI SPACE
STRING terminal.app
ENTER
DELAY 100
STRING echo "*/2 * * * * osascript -e 'set volume 7' && open 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'" | crontab -
ENTER
DELAY 100
GUI q
@JWardee
JWardee / MyCustomProductsController.php
Created Feb 22, 2018
Instantiate this class to stop product images from being duplicated when creating a product using the WooCommerce API
View MyCustomProductsController.php
<?php
class MyCustomProductsController extends WC_REST_Products_Controller
{
public function register_routes()
{
register_rest_route( $this->namespace, '/' . $this->rest_base, array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
@JWardee
JWardee / equate-height.js
Last active Jan 8, 2018
Vue directive that will equalise the height of elements on initial load, window resize and component update
View equate-height.js
$ = require('jquery');
_ = require('lodash');
Vue.directive('equate-height', {
inserted: function (el, binding) {
this.equateHeight = new EquateHeight(el, binding.value);
},
componentUpdated: function() {
this.equateHeight.setHeight();
},
@JWardee
JWardee / ainsley.exe.js
Last active Dec 24, 2017
A little easter egg that quickly shows a little someone - do "ainsley.exe()" in the console to see
View ainsley.exe.js
var ainsley = {
exe: function() {
var egg = document.createElement('img');
egg.src = 'http://i0.kym-cdn.com/photos/images/facebook/000/114/193/1298574546091.jpg';
egg.setAttribute('style', 'position: fixed; top: 50%; left: 50%; z-index: 999999; transform: translate(-50%, -50%);');
document.body.appendChild(egg);
setTimeout(function() {
document.body.removeChild(egg);
}, 500);
}
@JWardee
JWardee / Demo.cs
Created Oct 25, 2015
Helper class for using the Facebook API with Unity v5, makes use of the excellent SimpleJSON class to decode JSON objects https://gist.github.com/darktable/1411710
View Demo.cs
using UnityEngine;
using System;
public class Demo : MonoBehaviour {
void Start() {
new FB_Query("/me", callback);
}
public void callback(SimpleJSON.JSONNode result) {
@JWardee
JWardee / GeneralDirector.cs
Last active Jan 25, 2016
Helper class for executing a HTTP request using c# in Unity v5 by calling one function and supplying a callback (very similarly to jQuery)
View GeneralDirector.cs
using UnityEngine;
using System.Collections;
public class GeneralDirector : MonoBehaviour {
static public HTTP http;
public void Start () {
http = this.gameObject.GetComponent<HTTP> ();
}
}
@JWardee
JWardee / index.html
Created Jun 9, 2015
Multi level mobile menu
View index.html
<nav id="mobile_menu">
<div class="level _show" id="1">
<a href="#11">Link 1 <i class="ion-ios-arrow-right -icon"></i></a>
<a href="/about">Link 2</a>
<a href="/about">Link 3</a>
<a href="/about">Link 4</a>
<a href="/about">Link 5</a>
</div>
<div class="level" id="11">