Skip to content

Instantly share code, notes, and snippets.

View jmdobry's full-sized avatar

Jason Dobry jmdobry

View GitHub Profile
@jmdobry
jmdobry / Instructions.md
Last active August 31, 2021 18:21
Nginx reverse-proxy for RethinkDB Admin UI

Start your rethinkdb instance with this flag: --bind all (or bind=all in the configuration file for your instance)

Block external access to the web UI with these two commands: sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT

Install nginx: sudo apt-get install nginx

@jmdobry
jmdobry / gist:9508801
Created March 12, 2014 15:05
Jenkins reverse proxy and password

Install nginx: sudo apt-get install nginx

Create a new virtual host (server block): sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/jenkins

Edit this file: sudo vi /etc/nginx/sites-available/jenkins

to say:

@jmdobry
jmdobry / DSCustomAdapter.js
Created September 25, 2014 15:53
Creating custom adapters for angular-data
angular.module('myApp').provider('DSCustomAdapter', function () {
'use strict';
var defaults = this.defaults = {
queryTransform: function (resourceName, params) {
return params;
}
};
@jmdobry
jmdobry / app.js
Last active May 16, 2018 18:16
js-data + js-data-firebase + js-data-localstorage
var fb = new DSFirebaseAdapter({
basePath: 'https://my-app.firebase.io'
});
var ls = new DSLocalStorageAdapter();
var store = new JSData.DS({
// try firebase first, otherwise try offline data
fallbackAdapters: ['fb', 'ls'],
// After creating an item, sync it to localStorage
@jmdobry
jmdobry / fakeAdapter.js
Last active November 28, 2015 16:36
Custom JSData adapter
var store = new JSData.DS();
function FakeAdapter() {
var data = {};
function addMetaForResource(resource) {
if (resource.name !== data) {
data[resource.name] = {};
data[resource.name].curId = 1;
data[resource.name].index = {};
@jmdobry
jmdobry / Resource.js
Last active November 5, 2015 15:21
js-data v3 decorators
function basicIndex(target) {
target.$index = {}
target.$collection = []
}
/**
* Usage:
*
* @configure({
* idAttribute: '_id'
@jmdobry
jmdobry / keybase.md
Created December 15, 2016 01:15
keybase.md

Keybase proof

I hereby claim:

  • I am jmdobry on github.
  • I am jmdobry (https://keybase.io/jmdobry) on keybase.
  • I have a public key whose fingerprint is 9E28 A648 9AF5 B52E 76AF D314 CB8E 4C46 84A6 04DA

To claim this, I am signing this object: