Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am williejackson on github.
* I am williejackson (https://keybase.io/williejackson) on keybase.
* I have a public key whose fingerprint is 38B3 317B A51C C073 490F BB92 AFDA 967F 9308 AFDA
To claim this, I am signing this object:
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 27, 2025 16:31
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 20, 2025 23:00
A badass list of frontend development resources I collected over time.
@norcross
norcross / mass-delete-author.php
Created March 25, 2013 20:22
delete an author's posts
<?php
function mass_delete_author() {
$args = array(
'fields' => 'ids',
'author' => 31,
'posts_per_page' => 100,
'no_found_rows' => true,
'cache_results' => false
);
@kylerush
kylerush / s3-maxcdn-deploy.py
Created January 22, 2013 18:09
Git, S3 and MaxCDN Python deploy script. The script gets the changed file between the two latest Git commits, uploads the changed files to S3 and then purges the paths from MaxCDN using the API.
#!/usr/bin/env python
#install the follow first:
#sudo easy_install pip
#sudo pip install -U boto
#sudo pip install configparser
@kmccarth
kmccarth / nginx.conf
Last active October 5, 2019 08:29
nginx at Streetwise Media. This bad boy handled 2M+ UVs on one VM
user www-data;
worker_processes 4; # number of cores on machine
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
@chasereeves
chasereeves / gist:3350644
Created August 14, 2012 16:30
Wordpress similar posts without plugin
<?php
//=========================================================== SIDEBAR == Similar Posts
function similar_posts() {
echo "<li class=\"widget similar_posts\">";
echo "<h3>Similar Posts</h3>";
echo "<ul>";
global $post;
//stores the original post data
$original_post = $post;
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@chasereeves
chasereeves / gist:2361153
Created April 11, 2012 18:24
PHP: List all images from directory
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>&lt;img src="Matterful"&gt;</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Chase Reeves">
<!-- Date: 2012-04-04 -->