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 = work.data.substring(0, 128);
var data = work.data.substring(128, 256);
data = jsMiner.Util.fromPoolString(data);
half = jsMiner.Util.fromPoolString(half);
var hash1 = jsMiner.Util.fromPoolString(work.hash1);
var target = jsMiner.Util.fromPoolString(work.target);
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 {
server_name jason.whitehorn.us;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/nginx/jason.whitehorn.us.crt;
ssl_certificate_key /etc/nginx/jason.whitehorn.us.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:AES128-SHA:RC4-SHA;
View jason_whitehorn_us.conf
limit_req_zone $binary_remote_addr zone=jason_whitehorn_us:5m rate=5r/m;
server {
server_name jason.whitehorn.us;
listen 443 ssl;
listen [::]:443 ssl;
ssl_client_certificate /etc/nginx/whitehorn-ca.crt;
ssl_certificate /etc/nginx/jason.whitehorn.us.crt;
ssl_certificate_key /etc/nginx/jason.whitehorn.us.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
View contents.json
{
"url": "https://www.datasyncbook.com/login/?redirect_to=https%3A%2F%2Fwww.datasyncbook.com%2Fcontent%2Fdelta-based-synchronization%2F",
"file": "html/chapter2.xhtml",
"login": {
"username": "user",
"password": "secret!",
"action": "/login/"
}
}
View contents.json
[
{
"url": "https://www.datasyncbook.com/content/introduction/",
"file": "html/intro.xhtml",
"login": null
},
{
"url": "https://www.datasyncbook.com/content/server-to-client-updates/",
"file": "html/part1.xhtml",
"login": null
View toc.xhtml
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head></head>
<body>
<nav epub:type="toc" id="toc">
<h1>Table of contents</h1>
<ol>
<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
$BODY$
begin
insert into deleted_records(table_name,record_id,deleted_at)
select 'campground_reviews', OLD.id, now();
end;
$BODY$
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.