Skip to content

Instantly share code, notes, and snippets.

View chrismeller's full-sized avatar

Chris Meller chrismeller

View GitHub Profile
@chrismeller
chrismeller / gist:fa9d7fcc1393e209c3882041b6c7296d
Last active December 9, 2020 09:14
Yandex Weather uBlock Origin Rules
!right-hand ads on the main page
yandex.*##:xpath(//div[ contains( @class, 'content__bottom' ) ]/following-sibling::div[1])
yandex.*##:xpath(//div[ contains( @class, 'content__bottom' ) ]/following-sibling::div[2])
!row-level ads on the main page
yandex.*##:xpath(//div[ contains( @class, 'card' ) and not(contains( @class, 'maps' )) and descendant::script ])
!right-hand ads on the monthly page
yandex.*##:xpath(//div[ contains( @class, '__content' ) and descendant::div[ contains( @class, 'page30days' ) ] ]/following-sibling::div[1])
!bottom ads on the monthly page
yandex.*##:xpath(//section[ contains( @class, 'content__section' ) and descendant::script ][2])
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 August 29, 2015 14:06
Bookmarklet for Jumping to Harvest Monthly Report
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();
"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 April 16, 2014 17:48
Nginx vhost redirect only certain URIs to ssl
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 April 16, 2014 17:47
Nginx vhost redirect to ssl
server {
include listen_80;
server_name www.example.com;
rewrite ^ https://www.example.com$request_uri$is_args$args;
}
@chrismeller
chrismeller / keybase.md
Created February 19, 2014 18:01
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:

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 December 13, 2015 16:39
Crappy WXR Parser using PHP DOM
<?php
date_default_timezone_set('UTC');
error_reporting(-1);
ini_set('display_errors', true);
$file = '/Users/chris/Downloads/wordpress-wxr-example.xml';
@chrismeller
chrismeller / gist:4748208
Last active December 12, 2015 08:59
https vhost
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;