Skip to content

Instantly share code, notes, and snippets.

Jason Whitehorn jwhitehorn

Block or report user

Report or block jwhitehorn

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 engine.js
this.handleGetWorkResponse = function(response){
var work = eval("(" + response + ")");
var midstate = jsMiner.Util.fromPoolString(work.midstate);
var half =, 128);
var data =, 256);
data = jsMiner.Util.fromPoolString(data);
half = jsMiner.Util.fromPoolString(half);
var hash1 = jsMiner.Util.fromPoolString(work.hash1);
var target = jsMiner.Util.fromPoolString(;
View nginx.conf
proxy_set_header X-SSL-Client-Cert $ssl_client_raw_cert;
View jason_whitehorn_us.conf
location = /wp-login.php {
if ($ssl_client_verify != SUCCESS) {
return 403;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
View server.conf
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
View jason_whitehorn_us.conf
limit_req_zone $binary_remote_addr zone=jason_whitehorn_us:5m rate=5r/m;
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_client_certificate /etc/nginx/whitehorn-ca.crt;
ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
View contents.json
"url": "",
"file": "html/chapter2.xhtml",
"login": {
"username": "user",
"password": "secret!",
"action": "/login/"
View contents.json
"url": "",
"file": "html/intro.xhtml",
"login": null
"url": "",
"file": "html/part1.xhtml",
"login": null
View toc.xhtml
<html xmlns="" xmlns:epub="">
<nav epub:type="toc" id="toc">
<h1>Table of contents</h1>
<li><a href="intro.xhtml">Introduction</a> </li>
<li><a href="part1.xhtml">Part 1: Server to Client Updates</a> </li>
<li> <a href="chapter1.xhtml">Chapter 1: Whole Database Synchronization</a></li>
<li> <a href="chapter2.xhtml">Chapter 2: Delta-based Synchronization</a></li>
View trigger.sql
create or replace function do_record_deleted_campground_reviews()
returns trigger as
insert into deleted_records(table_name,record_id,deleted_at)
select 'campground_reviews',, now();
language plpgsql;
View database.js
var CampgroundReview = db.define("campground_reviews", {
headline: String,
body: String,
rating: Number,
campground_id: Number,
updated_at: Date
}, {
hooks: {
beforeSave: function(next){
this.updated_at = new Date();
You can’t perform that action at this time.