Skip to content

Instantly share code, notes, and snippets.

View rarous's full-sized avatar
💭
I may be slow to respond.

Aleš Roubíček rarous

💭
I may be slow to respond.
View GitHub Profile
const updateState = app => m => app.updateData(app.state.withMutations(m));
const cleanup = app => ::app.dispose;
export default function(apiUrl, gtmKey) {
const api = apiFactory(apiUrl);
const data = fromJS(appState);
return async (req, res, next) => {
try {
const app = new Application(data);
const routes = defRoutes(app);
[
[:app "cmd-t" :workspace.show]
[:app "cmd-shift-f" :searcher.show]
[:app "cmd-shift-k" :clear-console]
[:app "cmd-shift-s" :save-all]
[:app "cmd-ctrl-f" :window.fullscreen]
[:app "cmd-k" :toggle-console]
[:app "tab" :focus-last-editor]
[:workspace.focused "enter" :lt.plugins.workspace-nav/open-selection]
.theme-atom-visual-studio-code-light-ui {
font-family: 'Segoe WPC', 'Segoe UI', SFUIText-Light, HelveticaNeue-Light, sans-serif, 'Droid Sans Fallback';
atom-pane-container atom-pane {
padding: 0;
.item-views {
border: 0;
border-top: 2px solid #007ACC;
}
.host {
display: inline-block;
position: relative;
width: 400px;
border: 1px solid;
padding: 2px;
-moz-appearance: textarea;
-webkit-appearance: textarea;
}
.host .mirrorText {
const projects = company.get('projects', List());
return (
<PaperCard heading='Our Projects'>
<PaperCardContent>
{projects.map((p, i) =>
<Project key={`proj${i}`} project={p} />
)}
</PaperCardContent>
</PaperCard>
);
brew install docker-machine
docker-machine create -d virtualbox --virtualbox-import-boot2docker-vm boot2docker-vm docker-vm
brew uninstall --force boot2docker
var testsContext = require.context(".", true, /-spec.js$/);
testsContext.keys().forEach(testsContext);
[Test]
public void ShouldRoundtripSerialization() {
var config1 = new FsAgentSpecificConfiguration { DropPath = "test" };
FsAgentSpecificConfiguration config2;
using (var ms = new MemoryStream()) {
var serializer = new XmlSerializer(typeof(FsAgentSpecificConfiguration));
serializer.Serialize(ms, config1);
ms.Position = 0;
config2 = (FsAgentSpecificConfiguration)serializer.Deserialize(ms);
@rarous
rarous / gist:34856a3bfe628eb81c37
Last active September 1, 2017 14:45
Disposable event subsription for Firebase.
function subscribe(firebase, event, callback) {
firebase.on(event, callback);
return {
dispose: () => firebase.off(event, callback);
};
}
@rarous
rarous / Application.js
Last active August 29, 2015 14:17
Complete sources for "Potřebujeme Flux?" article.
import Kefir from 'kefir';
import {List, Stack} from 'immutable';
import {comp, filter, map} from 'transducers-js';
function register(stream, messageType, handler) {
let xform = comp(
filter(x => x.first() === messageType),
map(x => x.rest()));
stream.transduce(xform).onValue(handler);
}