Skip to content

Instantly share code, notes, and snippets.

View jimbojsb's full-sized avatar

Josh Butts jimbojsb

View GitHub Profile
jimbojsb / gist:41f8331a0469db4b5ea6f7d690b674c3
Created July 24, 2018 04:51
Cloudflare Github Validation
addEventListener('fetch', event => {
async function handleRequest(request) {
const ip = request.headers.get('cf-connecting-ip');
const ghHeaders = new Headers();
ghHeaders.append("User-agent", "Cloudflare")
response = await fetch('', {headers: ghHeaders}).then(function(response) {
jimbojsb / Docker
Created October 31, 2016 14:38
Docker Tutorial Prereqs

For the Containerizing PHP Applications tutorial, if you'd like to follow along, you'll need a working Docker install on your laptop. I'll be using Docker version 1.12, though the versions aren't particularly important for basic concepts.

For Mac users: I strongly recommend you install Docker for Mac ( Docker Toolbox or Docker Machine will work, but they are more complicated and Docker for Mac is the officially recommended way to run Docker on macOS.

For Windows users: I don't have much experience running Docker on Windows, but the new Docker for Windows looks promising, and should be more transparent than using Docker Machine. It does require Windows 10 to work.

For Linux users: Install Docker via the appropriate package manager for your OS.

We will also be using Docker Compose. Docker for Mac and Docker for Windows include a proper version of Docker Compose out of the box. Linux users may need to install a separate package for this.

jimbojsb / docker-compse.yml
Created July 28, 2016 14:22
docker compose dev
build: .
command: /seaglass/docker/
- 20019:80
- ~/projects/seaglass:/seaglass
- redis
FROM offers/baseimage:0.2.2
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/seaglass/vendor/bin
RUN echo "America/Chicago" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
RUN curl | apt-key add - && echo deb newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
RUN apt-add-repository -y ppa:ondrej/php \
jimbojsb /
Last active December 11, 2015 15:28
Disable Jira Agile / GreenHopper issue detail view on Kanban Board
  1. Get a user style tool for your browser of choice. I used Stylish for Chrome
  2. Add a stylesheet for your jira hostname with the following:
#ghx-detail-view {
    display: none;
jimbojsb /
Last active October 17, 2015 20:58
Zendcon Docker Tutorial README

Is there anythign I should read ahead of time?

Probably not, we're going to cover Docker from basic concepts into a working PHP app environment

Should I install any software?

Yes and no. While I will strive to make this session as interactive as possible, working with Docker does involve moving a good bit of data around, and we are at the mercy of Conference Wifi. The tutorial will be geared towards MacOS and Linux users but should be equally doable on Windows, though I have no personal experience using Docker on Windows.

I definitely encourage you to install the software locally and work along with what I'm demonstrating. I will cover basic installation and setup but won't have time to get into issues with anyone's specific system.

I will be working through the content with the following:

  • Docker 1.6.2
image: private.registry:master
- 8080
image: private.registry:feature123
- 8081
jimbojsb / crawl.php
Created March 24, 2015 15:34 Crawler
"require": {
"symfony/dom-crawler": "2.*",
"symfony/css-selector": "2.*"
// coercive types, as per PersonFactory author's specification
class ElePHPant {
public $name, $age, $cuteness, $evil;
public function __construct(~string $name, ~int $age, ~float $cuteness, ~bool $evil) {
$this->name = $name;
$this->age = $age;
$this->cuteness = $cuteness;
$this->evil = $evil;
jimbojsb / tweet.html
Last active August 29, 2015 14:17
Wes Finder - Javascript Exercise
<link rel="stylesheet" href="">
<script src=""></script>
<!-- fill in javascript as necessary -->
<!-- make the characters used counter live-updating as you type -->
<!-- if the user tries to submit the form with more than 140 characters, display a useful error message -->
<script type="text/javascript">