Skip to content

Instantly share code, notes, and snippets.

View jimbojsb's full-sized avatar

Josh Butts jimbojsb

View GitHub Profile
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@jimbojsb
jimbojsb / crawl.php
Created March 24, 2015 15:34
Entertainment.com Crawler
<?php
/**
{
"require": {
"symfony/dom-crawler": "2.*",
"symfony/css-selector": "2.*"
}
}
*/
@jimbojsb
jimbojsb / gist:1665345
Created January 23, 2012 20:20
Delete resolved jira ticket branches
#!/bin/bash
for i in $(git branch | grep "OFR-"); do
xml="`wget -qO- http://jira.office.vertive.com/si/jira.issueviews:issue-xml/$i/$i.xml`"
closed=`echo $xml | grep ">Closed</status"`
strlen=${#closed}
if [ ! $strlen == "0" ]
then
echo "Deleting $i"
git branch -D $i
fi
@jimbojsb
jimbojsb / gist:41f8331a0469db4b5ea6f7d690b674c3
Created July 24, 2018 04:51
Cloudflare Github Validation
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const ip = request.headers.get('cf-connecting-ip');
const ghHeaders = new Headers();
ghHeaders.append("User-agent", "Cloudflare")
response = await fetch('https://api.github.com/meta', {headers: ghHeaders}).then(function(response) {
@jimbojsb
jimbojsb / nav-list.less
Last active February 6, 2018 21:57
.nav-list for Bootstrap 3.0
.nav-list {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 0;
}
.nav-list > li > a,
.nav-list .nav-header {
margin-left: -15px;
margin-right: -15px;
@jimbojsb
jimbojsb / Docker Tutorial.md
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 (https://docs.docker.com/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
jimbojsb / docker-compse.yml
Created July 28, 2016 14:22
docker compose dev
web:
build: .
command: /seaglass/docker/bootstrap-dev.sh
ports:
- 20019:80
volumes:
- ~/projects/seaglass:/seaglass
links:
- redis
environment:
FROM offers/baseimage:0.2.2
EXPOSE 80
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/seaglass/vendor/bin
ENV APPLICATION_ENV production
RUN echo "America/Chicago" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
RUN curl https://download.newrelic.com/548C16BF.gpg | apt-key add - && echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
RUN apt-add-repository -y ppa:ondrej/php \
All,
In an effort to try and figure out how we can get more done, I need to collect some more data on what we're currently doing and how long it's taking. As I mentioned last week, please make sure to log work on tickets at the time the work is done, don't save it until the ticket is complete. For tickets that take >1 day, I would expect this means you're at least logging work on them twice a day. I want to make sure the estimates and work logs on the ticket are for programming time only. Don't factor in the auxiliary tasks like code reviews or acceptance meetings in either the estimates or the work logs. If you have to go spend 2 hours learning something to get a ticket accomplished, go ahead and count that as a work log, and also include it in the estimates.
The main things i'm trying to learn are 1) how much capacity do build things do we actually have, and 2) can we get more by improving efficiency, and if not, how many people do we need to hire. With that in mind, and looking at past weeks' number o
@jimbojsb
jimbojsb / gist:5551751
Created May 10, 2013 00:58
Hack way to get XML into a corresponding PHP array
<?php
$array = json_decode(json_encode(simplexml_load_string($str)), true);