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
function doMoneyMaking(dispatch) { | |
return apiCall() | |
.then(() => { | |
dispatch({ type: MAKE_MONEY_SUCCESS }); | |
}) | |
} | |
const actions = { | |
makeMoney() { | |
return doMoneyMaking; |
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
const { createStore, combineReducers, applyMiddleware, compose } = require('redux'); | |
const reducers = require('app/reducers'); | |
const thunkMiddleware = require('redux-thunk'); | |
const simpleDispatchThunkMiddleware = require('app/redux/simple_dispatch_thunk_middleware'); | |
const { batchedUpdates } = require('redux-batched-updates'); | |
const simpleDispatch = require('app/redux/simple_dispatch'); | |
const finalCreateStore = compose( | |
applyMiddleware(thunkMiddleware), | |
simpleDispatch, |
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 = function simpleDispatchThunkMiddleware({ dispatch, getState }) { | |
const newDispatch = (type, payload) => { | |
if (typeof type === 'object') { | |
dispatch(type); | |
} else { | |
dispatch({ type, payload }); | |
} | |
}; | |
return next => action => |
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
function addSimpleDispatch(thunk) { | |
return ({ dispatch, getState }) => { | |
function simpleDispatch(type, payload) { | |
if (typeof type === 'string') { | |
return dispatch({ type, payload }); | |
} else { | |
return dispatch(type); | |
} | |
} |
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
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):"object"==typeof exports?exports.updeep=n():t.updeep=n()}(this,function(){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var o=r(21),u=e(o),i=r(42),f=e(i),a=r(41),c=e(a),s=r(43),l=e(s),p=r(44),v=e(p),d=r(45),h=e(d),y=r(7),g=e(y),x=r(46),_=e(x),b=r(47),j=e(b),m=r(9),w=g.default;w.if=c.default(m.placeholder,m.placeholder,{}),w.ifElse=c.default,w.is=f.default,w.freeze=u.default,w.map=l.default,w.omit=v.default,w.reject=h.default,w.update=g.default,w.updateIn=_.default,w.withDefault=j.default,n.default=w,t.exports=n.default},function(t,n){function r(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}t.exports=r},function(t,n |
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
private static IEnumerable<Type> GetTypesInDirectoryWithExtension(string path, string extension) | |
{ | |
foreach (FileInfo file in new DirectoryInfo(path).GetFiles(extension, SearchOption.AllDirectories)) | |
{ | |
Type[] types = null; | |
try | |
{ | |
Assembly a = Assembly.LoadFrom(file.FullName); | |
types = a.GetTypes(); |
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
[Serializable] | |
public class Cache<TKey, TValue> : IIndexer<TKey, TValue> where TValue : class | |
{ | |
readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(); | |
readonly IDictionary<TKey, TValue> _values; | |
Func<TValue, TKey> _getKey = delegate { throw new NotImplementedException(); }; | |
Action<TValue> _onAddition = x => { }; | |
Func<TKey, TValue> _onMissing = delegate(TKey key) |
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
routes.MapRouteTo<DiagnosticsController>(Urls.root.debug, x => x.Index()); | |
routes.MapRouteTo<DiagnosticsController>(Urls.root.diagnostics.ok, x => x.Ok()); | |
routes.MapRouteTo<DiagnosticsController>(Urls.root.diagnostics.raise, x => x.Raise()); | |
routes.MapRouteTo<LoginController>(Urls.root.login, x => x.Login(null)); | |
routes.MapRouteTo<LoginController>(Urls.root.logout, x => x.Logout()); | |
routes.MapRouteTo<StyleguideController>(Urls.root.styleguide, x => x.Styleguide()); |
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
# Needs Ruby 1.8.7 | |
# gem install hipchat | |
# gem install xmpp4r-simple | |
# gem install daemons | |
# run with ruby zen_to_hipchat.rb start | |
require 'rubygems' | |
require 'hipchat' | |
require 'xmpp4r-simple' |
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
<%= semantic_form_for @decision do |form| %> | |
<%= form.inputs(:name => "Questions", :for => :answer_to_questions) do |field| %> | |
<%= field.input :decision_question_id, :as => :hidden %> | |
<%= field.input :decision_answer, :as => :radio, :collection => field.object.decision_question.decision_answers, :label => field.object.decision_question.text %> | |
<% end %> | |
<%= form.inputs do %> | |
<%= form.input :category_id, :as => :hidden %> | |
<% end %> | |
<%= form.buttons do %> |