Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
// config/environment.js | |
// This is not for production. But it will get your | |
// console to stop screaming errors if your messing | |
// around with ember cli | |
module.exports = function(environment) { | |
//lots of stuff | |
// <Add this chunk> |
Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.
import Reconciler from 'react-reconciler' | |
import omit from 'lodash/omit' | |
import capitalize from 'lodash/capitalize' | |
import { actions as elementActions } from './store/elements' | |
import * as Elements from './elements' | |
const roots = new Map() | |
const emptyObject = {} | |
const Renderer = Reconciler({ |
var gmtOffset = - new Date().getTimezoneOffset() / 60; | |
if (gmtOffset >= -11 && gmtOffset <= -6) { | |
window.location.href='#'; | |
} else if (gmtOffset <= -4) { | |
window.location.href='#'; | |
} else { | |
window.location.href='#'; | |
} |
'use strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} from 'react-native'; |
handleDrop = files => { | |
// Push all the axios request promise into a single array | |
const uploaders = files.map(file => { | |
// Initial FormData | |
const formData = new FormData(); | |
formData.append("file", file); | |
formData.append("tags", `codeinfuse, medium, gist`); | |
formData.append("upload_preset", "pvhilzh7"); // Replace the preset name with your own | |
formData.append("api_key", "1234567"); // Replace API key with your own Cloudinary key | |
formData.append("timestamp", (Date.now() / 1000) | 0); |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |