Skip to content

Instantly share code, notes, and snippets.

Jason Dobry jmdobry

Block or report user

Report or block jmdobry

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
@jmdobry
jmdobry / Instructions.md
Last active Sep 3, 2019
Nginx reverse-proxy for RethinkDB Admin UI
View Instructions.md

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 / app.js
Last active May 16, 2018
js-data + js-data-firebase + js-data-localstorage
View app.js
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
View 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:

@jmdobry
jmdobry / fakeAdapter.js
Last active Nov 28, 2015
Custom JSData adapter
View fakeAdapter.js
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 Nov 5, 2015
js-data v3 decorators
View Resource.js
function basicIndex(target) {
target.$index = {}
target.$collection = []
}
/**
* Usage:
*
* @configure({
* idAttribute: '_id'
@jmdobry
jmdobry / DSCustomAdapter.js
Created Sep 25, 2014
Creating custom adapters for angular-data
View DSCustomAdapter.js
angular.module('myApp').provider('DSCustomAdapter', function () {
'use strict';
var defaults = this.defaults = {
queryTransform: function (resourceName, params) {
return params;
}
};
@jmdobry
jmdobry / gist:9508801
Created Mar 12, 2014
Jenkins reverse proxy and password
View gist:9508801

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:

You can’t perform that action at this time.