This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = | |
rethinkdb: | |
host: 'localhost', | |
port: 28015, | |
authKey: '', | |
db: 'rethinkdb', | |
tables: [ | |
{ | |
name: 'todos', | |
indices: ['createdAt'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init = require './init' | |
# ... | |
init.createDbIfNotExists() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = require 'rethinkdb' | |
config = require './config' | |
module.exports = | |
### | |
## This creates the db. If there occurs an error | |
## it will be printed out. If it succeeds, the | |
## callback next will be called. | |
### | |
createDb: (next) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
## Check if database exists. If it does not exist | |
## create it and create all tables and indices. | |
## The names of the Db, tables and indices are | |
## specified in config.coffee | |
### | |
createDbIfNotExists: () -> | |
r.connect config.rethinkdb, (err, connection) => | |
if err | |
console.log "Could not open a connection to initialize the database" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
## This creates the db. If there occurs an error | |
## it will be printed out. If it succeeds, the | |
## callback next will be called. | |
### | |
createDb: (next) -> | |
r.dbCreate(config.rethinkdb.db).run @conn, (err, result) => | |
if (err) and (not err.message.match(/Database `.*` already exists/)) | |
console.log "Could not create the database `" + config.db + "`" | |
console.log err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
## This creates the given table. The table param | |
## is either a string with the table name or an | |
## object with at least one parameter 'name' and | |
## optional the indices to create as string array. | |
## If there occurs an error it will be printed out. | |
## If it succeeds, the callback next will be called. | |
### | |
createTable: (table, next) -> | |
if typeof(table) is 'string' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
## This creates the given index for the given | |
## table. If there occurs an error | |
## it will be printed out. If it succeeds, the | |
## callback next will be called. | |
### | |
createIndex: (tableName, indexName, next) -> | |
r.table(tableName).indexCreate(indexName).run @conn, (err, result) => | |
if (err) and (not err.message.match(/Index `.*` already exists/)) | |
console.log "Could not create the index `" + tableName + "." + indexName + "`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
import os | |
import sys | |
try: | |
authorized = False | |
directory = None | |
addr = None | |
with open('moveto.log', 'w') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~ | |
# install linuxbrew | |
git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew | |
echo "PATH=\"$HOME/.linuxbrew/bin:$PATH\"" >> ~/.bashrc | |
echo "MANPATH=\":$HOME/.linuxbrew/share/man:$MANPATH\"" >> ~/.bashrc | |
echo "INFOPATH=\"$HOME/.linuxbrew/share/info:$INFOPATH\"" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /' >> /etc/apt/sources.list.d/fish.list | |
apt-get update | |
wget -qO - http://download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key | apt-key add - | |
apt-get update | |
apt-get install -y fish |
OlderNewer