Skip to content

Instantly share code, notes, and snippets.

View codedmart's full-sized avatar

Brandon Martin codedmart

View GitHub Profile
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'}
var Auth = require('auth');
console.log(Auth.Authentication);
module.exports.Authentication = {
statics: {
willTransitionTo: (transition) => {
console.log('this: ', this.props);
}
}
};
/** @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;
fileSystems."/mnt/osx" = {
device = "10.0.2.2:/Users/username";
fsType = "nfs";
};
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)
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
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 ->
weak <- mkWeakPtr mbox $ Just $ do
closeToken h tok -- TODO: don't close if already closed
atomicModifyIORef' (rdbWait h) $ \mboxes ->
(M.delete tok mboxes, ())
instance FromDatum a => Result (Cursor a) where
convertResult r = do
(v, _) <- convertResult r
(_, p) <- responseProfile v
c <- makeCursor r
return (c { cursorMap = unsafeFromDatum }, p)