Skip to content

Instantly share code, notes, and snippets.

View barkgj's full-sized avatar

Gert-Jan Bark barkgj

View GitHub Profile
<?php
class JPB_User_Caps {
/**
* An array of all protected roles
* @var array
*/
protected $protectedRoles = array(
'webmaster',
@barkgj
barkgj / LICENSE
Created October 23, 2015 08:32 — forked from ifraixedes/LICENSE
AWS lambda handler which download images from S3, resizes them and upload the new ones to S3; tested with mocha, chai, sinon and proxyquire
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Mario Mendes (@hyprstack)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@barkgj
barkgj / screenshots.rake
Created March 10, 2017 08:43 — forked from thijsc/screenshots.rake
Example of creating screenshots of your site using Capybara and Selenium, for details: http://blog.appsignal.com/blog/2015/07/21/automated-screenshots-using-capybara.html
BROWSER_WIDTH = 1600
BROWSER_HEIGHT = 1200
Capybara.default_driver = :selenium
include Capybara::DSL
def take_screenshot(path, name, convert_options={})
# Wait for JS to load data and so on
sleep 2
retinafy_screen
@barkgj
barkgj / Enigma.php
Created February 16, 2022 12:13 — forked from AlexR1712/Enigma.php
PHP Enigma Machine
<?php namespace App\Services;
/**
* A PHP version of the Enigma machine.
* Wikipedia: http://en.wikipedia.org/wiki/Enigma_machine
*
* This might not be an accurate representation. I have never seen, nor used an enigma machine.
* This class was created by reading the article at http://enigma.louisedade.co.uk/howitworks.html.
*
* Usage: