The redis configuration file is likely located at /usr/local/etc/redis.conf
cp /usr/local/etc/redis.conf /usr/local/etc/redis2.conf
Change the port number from 6379 to something else. I used 6380
# Retrieve the user | |
user = User.find(params[:user_id]) | |
# Get all of the messages for the user and order so that the most recent message is first | |
raw_messages = Message.where("sender_user_id=? or receiver_user_id=?", user.id, user.id).order("created_at DESC") | |
# Our goal is to make a hash that looks like this: | |
# { | |
# other_party_1: [msg1, msg2, msg3], | |
# other_party_2: [msg7, msg8, msg9], |
The redis configuration file is likely located at /usr/local/etc/redis.conf
cp /usr/local/etc/redis.conf /usr/local/etc/redis2.conf
Change the port number from 6379 to something else. I used 6380
Source: http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
https://www.youtube.com/watch?v=bUBtG39Q7dw
Stack - [a, b, c, d] | |
Start: | |
node4 -> node3 -> node2 -> node1 | |
Stack - no idea how many items are in it, only knows the top item | |
@data = node4 | |
Next - Add a new node to the stack - "push" | |
push(value) |
This will create a parents table, a kids table and a relationship between the two tables.
Create the Parents table
bundle exec rails generate model parents fname:string lname:string
Create the Kids table
bundle exec rails generate model kids fname:string lname:string
# Allows websocket connections on /websocket | |
upstream mysite { | |
server 127.0.0.1:3000; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
) | |
func main() { |
var hash = window.location.hash; | |
var token = '0007zWwBHQBqmKj6KIDMo5HENldn9hwYpfq8EPhqkn'; | |
var redirectUrl = 'https://reviews.local.apartmentguide.com/#' + token; | |
var url = 'https://primediaTest.okta.com/login/sessionCookieRedirect?token=' + token + '&redirectUrl=' + redirectUrl; | |
if(!hash.length) { | |
window.location.replace(url); | |
} |