Skip to content

Instantly share code, notes, and snippets.

@lheric
lheric / gist:31b8fe1689baca55f99ea16ab205ffd4
Created December 20, 2021 00:32
Terminus Sublime Build System for Python
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"focus": true,
"shell_cmd": "python3 -u \"$file\"",
"cwd": "$file_path",
}
@lheric
lheric / nginx.conf
Created January 13, 2019 01:54 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@lheric
lheric / pub-sub.js
Created December 13, 2018 12:13 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
@lheric
lheric / _GISTNAME
Created December 12, 2018 23:26
_ANY_DESCRIPTION
_CONTENT_GOES_HERE
@lheric
lheric / instructions.md
Created June 26, 2018 17:47 — forked from davisford/Setup MongoDB on localhost as Replica Set
Setup MongoDB replica set on local host with only a single primary

Add the replication section to the mongod.conf file:

$cat /usr/local/etc/mongod.conf
systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  engine: mmapv1
import gym
import numpy as np
import random
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import Adam
from collections import deque
class DQN:
@lheric
lheric / mm-standalone.conf
Created June 7, 2018 18:08 — forked from comerford/mm-standalone.conf
Config Files for MongoDB 3.0 Compression Testing
storage:
dbPath: "/data/db/300-mm"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/data/db/300-mm/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
@lheric
lheric / mm-standalone.conf
Created June 7, 2018 18:08 — forked from comerford/mm-standalone.conf
Config Files for MongoDB 3.0 Compression Testing
storage:
dbPath: "/data/db/300-mm"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/data/db/300-mm/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
@lheric
lheric / discrete_cmap.py
Created September 12, 2017 11:26 — forked from jakevdp/discrete_cmap.py
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
@lheric
lheric / discrete_cmap.py
Created September 12, 2017 11:26 — forked from jakevdp/discrete_cmap.py
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""