Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Butts jimbojsb

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

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 / gist:1665345
Created Jan 23, 2012
Delete resolved jira ticket branches
View gist:1665345
#!/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
View gist:41f8331a0469db4b5ea6f7d690b674c3
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 Feb 6, 2018
.nav-list for Bootstrap 3.0
View nav-list.less
.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 Oct 31, 2016
Docker Tutorial Prereqs
View Docker Tutorial.md

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.

View docker-compse.yml
web:
build: .
command: /seaglass/docker/bootstrap-dev.sh
ports:
- 20019:80
volumes:
- ~/projects/seaglass:/seaglass
links:
- redis
environment:
View gist:c928ed7248b2296e83d96dc6138dbfa0
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 \
View gist:6424630
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
Hack way to get XML into a corresponding PHP array
View gist:5551751
<?php
$array = json_decode(json_encode(simplexml_load_string($str)), true);
@jimbojsb
jimbojsb / gist:5375295
Created Apr 12, 2013
Static function singleton
View gist:5375295
---foo.php
Namespace mylib;
class Foo implements ArrayAccess
{
public function _call()
}
--bar.php
You can’t perform that action at this time.