git show <hash>:<file>
git log -p <filename>
class HealthCheckResponder | |
def initialize(app, options = {}) | |
@app = app | |
end | |
def call(env) | |
if env["REQUEST_PATH"] == "/health_check" | |
return [200, {}, [""]] | |
else |
Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask
If you already have Java
installed on your system, skip steps Install Cask and Install Java
If you already have Java
and Homebrew
installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1. Dump the data only sql to file | |
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql | |
2. scp to local | |
3. Remove the SET statements at the top | |
such as: | |
SET statement_timeout = 0; | |
SET client_encoding = 'SQL_ASCII'; | |
4. Remove the setval sequence queries |
var Col = require('react-bootstrap/lib/Col') | |
var PageHeader = require('react-bootstrap/lib/PageHeader') | |
var React = require('react') | |
var Row = require('react-bootstrap/lib/Row') | |
var {connect} = require('react-redux') | |
var {reduxForm} = require('redux-form') | |
var DateInput = require('./DateInput') | |
var FormField = require('./FormField') | |
var LoadingButton = require('./LoadingButton') |
// give it a name so it reuses the same window | |
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no"); | |
// reload in case it's reusing the same window with the old content | |
win.location.reload(); | |
// wait a little bit for it to reload, then render | |
setTimeout(function() { | |
React.render( | |
<DebugPanel top right bottom left > |
# The built-in Rails database rake task is completely crazy, and defines methods on Object. This causes | |
# problems with Makara, which uses a delegator pattern along with method_missing. | |
require 'active_support/core_ext/object/inclusion' | |
require 'active_record' | |
class Object | |
remove_method :configs_for_environment | |
remove_method :create_database | |
remove_method :current_config |
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands | |
# cat paths | |
/_cat/allocation | |
/_cat/shards | |
/_cat/shards/{index} | |
/_cat/master | |
/_cat/nodes | |
/_cat/indices | |
/_cat/indices/{index} |
export class HttpClient { | |
constructor(defaults) { | |
this.defaults = defaults; | |
this.interceptors = []; | |
this.activeRequestCount = 0; | |
this.isRequesting = false; | |
} | |
addInterceptor(interceptor) { | |
this.interceptors.push(interceptor); |
CREATE EXTENSION btree_gist; | |
CREATE TABLE room_reservations ( | |
room_id integer, | |
reserved_at timestamptz, | |
reserved_until timestamptz, | |
canceled boolean DEFAULT false, | |
EXCLUDE USING gist ( | |
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH && | |
) WHERE (not canceled) |