Skip to content

Instantly share code, notes, and snippets.

View codedmart's full-sized avatar

Brandon Martin codedmart

View GitHub Profile
addMBox :: RethinkDBHandle -> Token -> Term -> IO (TVar Response)
addMBox h tok term = do
chan <- newChan
-- TVar doesn't have an empty state?
mbox <- newTVarIO $ ResponseSingle Nothing Null
weak <- mkWeakTVar mbox $ do
closeToken h tok -- TODO: don't close if already closed
atomicModifyIORef' (rdbWait h) $ \mboxes ->
(M.delete tok mboxes, ())
atomicModifyIORef' (rdbWait h) $ \mboxes ->
responseProfile :: IO Response -> IO (Response, Maybe Profile)
responseProfile r = r >>= \r' -> case r' of
ResponseSingle profile _ -> return (r', profile)
ResponseError _ -> return (r', Nothing)
ResponseBatch _ profile _ -> return (r', profile)
instance FromDatum a => Result (Cursor a) where
convertResult v = do
(r, p) <- responseProfile v
c <- makeCursor $ return r
Job for mnt-osx.mount failed. See "systemctl status mnt-osx.mount" and "journalctl -xe" for details.
warning: the following units failed: mnt-osx.mount
● mnt-osx.mount - /mnt/osx
Loaded: loaded (/etc/fstab)
Active: failed (Result: exit-code) since Fri 2015-01-09 11:21:57 MST; 20ms ago
Where: /mnt/osx
What: osx:/Users/user
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
fileSystems."/mnt/osx" = {
device = "10.0.2.2:/Users/username";
fsType = "nfs";
};
/** @jsx React.DOM */
var React = require('react');
var Component = require('omniscient');
module.exports = Home = Component(function(props) {
var cursor = props.data.cursor;
var onChange = function(e) {
cursor.update('content', function(content) {
return e.target.value;
module.exports.Authentication = {
statics: {
willTransitionTo: (transition) => {
console.log('this: ', this.props);
}
}
};
var Auth = require('auth');
console.log(Auth.Authentication);
var Immstruct = require('immstruct');
// How do I select otherStuff {id: 3, name: 'Name'}
var Structure = Immstruct({
stuff: {},
otherStuff: [
{id: 1, name: 'test'},
{id: 2, name:'Output'},
{id: 3, name: 'Name'},
{id: 4, name: 'Other'}
// Turn this into
{
one: {
a: {id: 1},
b: {id: 2}
},
two: {
c: {id: 3},
d: {id: 4}
},
@codedmart
codedmart / error
Last active August 29, 2015 14:14
Possibly unhandled From previous event:
at new Promise (/Users/bmartin/Work/modifyink/node_modules/rethinkdb/node_modules/bluebird/js/main/promise.js:84:37)
at TableCreate.TermBase.run (/Users/bmartin/Work/modifyink/node_modules/rethinkdb/ast.js:142:16)
at Connection.run (/Users/bmartin/Work/modifyink/server/lib/rdb.js:16:13)
at Object.init (/Users/bmartin/Work/modifyink/server/lib/rethinkdb-crud.js:76:17)
at Object.init (/Users/bmartin/Work/modifyink/server/lib/rethinkdb-crud.js:46:28)
at Model.init (/Users/bmartin/Work/modifyink/server/model/admin-controlled-settings.js:31:26)
at /Users/bmartin/Work/modifyink/server/config.js:242:50
at _fulfilled (/Users/bmartin/Work/modifyink/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/Users/bmartin/Work/modifyink/node_modules/q/q.js:827:30)