Skip to content

Instantly share code, notes, and snippets.

Drew Johnston drewjoh

Block or report user

Report or block drewjoh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drewjoh
drewjoh / sample.md
Last active Jun 18, 2019
Sample SSH Key Setup
View sample.md

First check that we have an ssh key. Type this in your terminal:

pbcopy < ~/.ssh/id_rsa.pub

If you get no error message, SUCCESS! Go to onetimesecret.com, paste your clipboard, and send me the link provided.

If you get the error: "No such file or directory"... follow these steps:

  1. Open Terminal.
  2. Paste the text below, substituting in your email address.
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@drewjoh
drewjoh / Cors.php
Created Jun 13, 2016
Laravel CORS Middleware
View Cors.php
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
@drewjoh
drewjoh / drewjoh.zsh-theme
Created Mar 24, 2016
OhMyZsh Custom Theme
View drewjoh.zsh-theme
#
# Forked from https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
# In addition, I recommend the
View keybase.md

Keybase proof

I hereby claim:

  • I am drewjoh on github.
  • I am drewjoh (https://keybase.io/drewjoh) on keybase.
  • I have a public key whose fingerprint is 78BB D4E4 2D09 91A3 A760 48D3 F6FF 27AB 17F3 3B17

To claim this, I am signing this object:

View ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@drewjoh
drewjoh / bootstrap.custom.css
Created Sep 15, 2012
CSS to make Laravel 3.2's built in pagination links work with Bootstrap 2.1.
View bootstrap.custom.css
.pagination a, .current, .previous_page, .next_page
{
float: left;
padding: 0 14px;
line-height: 34px;
text-decoration: none;
border: 1px solid #ddd;
border-left-width: 0;
}
@drewjoh
drewjoh / custom.js
Created Jan 27, 2012
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
View custom.js
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
@drewjoh
drewjoh / example.php
Last active Mar 1, 2019 — forked from mloberg/example.php
A Simple Postmark PHP Class with Attachments
View example.php
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
$result = $postmark->to("reciver@example.com")
->subject("Email Subject")
->plain_message("This is a plain text message.")
->attachment('File.pdf', base64_encode(file_get_contents('sample.pdf')), 'application/pdf')
@drewjoh
drewjoh / timezones.min.php
Created Oct 11, 2011
List of all timezones compatible with the PHP DateTimeZone object.
View timezones.min.php
$timezones = array('UTC','Africa/Abidjan','Africa/Accra','Africa/Addis_Ababa','Africa/Algiers','Africa/Asmara','Africa/Asmera','Africa/Bamako','Africa/Bangui','Africa/Banjul','Africa/Bissau','Africa/Blantyre','Africa/Brazzaville','Africa/Bujumbura','Africa/Cairo','Africa/Casablanca','Africa/Ceuta','Africa/Conakry','Africa/Dakar','Africa/Dar_es_Salaam','Africa/Djibouti','Africa/Douala','Africa/El_Aaiun','Africa/Freetown','Africa/Gaborone','Africa/Harare','Africa/Johannesburg','Africa/Juba','Africa/Kampala','Africa/Khartoum','Africa/Kigali','Africa/Kinshasa','Africa/Lagos','Africa/Libreville','Africa/Lome','Africa/Luanda','Africa/Lubumbashi','Africa/Lusaka','Africa/Malabo','Africa/Maputo','Africa/Maseru','Africa/Mbabane','Africa/Mogadishu','Africa/Monrovia','Africa/Nairobi','Africa/Ndjamena','Africa/Niamey','Africa/Nouakchott','Africa/Ouagadougou','Africa/Porto-Novo','Africa/Sao_Tome','Africa/Timbuktu','Africa/Tripoli','Africa/Tunis','Africa/Windhoek','America/Adak','America/Anchorage','America/Anguilla','Ameri
You can’t perform that action at this time.