Skip to content

Instantly share code, notes, and snippets.

Chris Meller chrismeller

Block or report user

Report or block chrismeller

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
View gist:dd25fa21566f381d21ad
server {
listen [::]:80;
listen *:80;
server_name blog.chrismeller.com;
root /home/chris/public_html/blog.chrismeller.com/public;
access_log /home/chris/public_html/blog.chrismeller.com/logs/access.log;
error_log /home/chris/public_html/blog.chrismeller.com/logs/error.log;
location ~ /\.git {
@chrismeller
chrismeller / gist:ae453245ff5a8d878c55
Last active Aug 29, 2015
Bookmarklet for Jumping to Harvest Monthly Report
View gist:ae453245ff5a8d878c55
javascript:
var this_month = new Date();
var first_day = new Date(this_month.getFullYear(), this_month.getMonth(), 1);
var last_day = new Date(this_month.getFullYear(), this_month.getMonth() + 1, 0);
var first_year = first_day.getFullYear();
var first_month = first_day.getMonth();
var first_date = first_day.getDate();
var last_year = last_day.getFullYear();
View config.json
"ranges": {
"Exxon Mobil": [
"192.67.48.0/24",
"158.35.254.0/24",
"158.35.252.0/24",
"158.35.238.0/23",
"158.35.225.0/24",
"158.35.223.0/24",
"158.35.176.0/22",
"158.35.0.0/16",
@chrismeller
chrismeller / gist:10912995
Created Apr 16, 2014
Nginx vhost redirect only certain URIs to ssl
View gist:10912995
server {
include listen_80;
server_name www.example.com;
root /home/chris/public_html/www.example.com/public;
access_log /home/chris/public_html/www.example.com/logs/access.log;
error_log /home/chris/public_html/www.example.com/logs/error.log;
location ~ /\.git {
deny all;
@chrismeller
chrismeller / gist:10912818
Created Apr 16, 2014
Nginx vhost redirect to ssl
View gist:10912818
server {
include listen_80;
server_name www.example.com;
rewrite ^ https://www.example.com$request_uri$is_args$args;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am chrismeller on github.
  • I am chrismeller (https://keybase.io/chrismeller) on keybase.
  • I have the public key with fingerprint BE47 C054 3F06 0391 DAF3  51BE 7C2E 30CD 9EDF 58DD

To claim this, I am signing this object:

View gist:6736979
id,user_id,type_id,severity_id,message,data,timestamp,ip
27643,1,28,6,"PDOStatement::execute(): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "habari__commentstatus" does not exist
LINE 1: SELECT id, name FROM habari__commentstatus;
^ in system/classes/databaseconnection.php:292",,1380326701,208.30.96.37
27644,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:494",,1380326701,208.30.96.37
27646,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:530",,1380326701,208.30.96.37
27647,1,28,6,"PDOStatement::execute(): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "habari__commentstatus" does not exist
LINE 1: SELECT id, name FROM habari__commentstatus;
^ in system/classes/databaseconnection.php:292",,1380326701,208.30.96.37
27648,1,28,6,"array_flip() expects parameter 1 to be array, boolean given in system/classes/comment.php:494",
@chrismeller
chrismeller / wxr-parser.php
Last active Dec 13, 2015
Crappy WXR Parser using PHP DOM
View wxr-parser.php
<?php
date_default_timezone_set('UTC');
error_reporting(-1);
ini_set('display_errors', true);
$file = '/Users/chris/Downloads/wordpress-wxr-example.xml';
View gist:4748208
server {
# the same as for non-ssl, except we indicate that when listening on port
# 443, it should use ssl
listen [::]:443 ssl;
server_name blog.chrismeller.com new.chrismeller.com;
# specify the certificate (chain) and key file to be used for this vhost
ssl_certificate ssl/chrismeller.com.2012.pem;
ssl_certificate_key ssl/chrismeller.com.2012.key;
View gist:4748175
server {
# we want to listen on port 80 on all IPs on our system - both IPv4 and IPv6
listen [::]:80;
# our primary server name is the first, aliases simply come after it. you can also include wildcards like *.example.com
server_name blog.chrismeller.com new.chrismeller.com;
# where are our site files stored?
root /media/www/public_html/blog.chrismeller.com/public;
# define our access and error logs for this vhost
You can’t perform that action at this time.