Skip to content

Instantly share code, notes, and snippets.

View sebastiandeutsch's full-sized avatar

Sebastian Deutsch sebastiandeutsch

View GitHub Profile
@sebastiandeutsch
sebastiandeutsch / geth.service
Created November 28, 2020 13:49
ETH2 Telegram Stuff
[Unit]
Description=Ethereum go client
After=network.target
Wants=network.target
OnFailure=unit-status-telegram@geth.service
StartLimitBurst=5
StartLimitIntervalSec=33
[Service]
User=goeth
Group=goeth
type Post {
id: ID,
title: String
text: String
}
type PaginationInfo<ResultType> {
page: Int
totalPages: Int
perPage: Int
@sebastiandeutsch
sebastiandeutsch / postAuthorizationAction.js
Created January 8, 2017 01:45
Redux example action using a concrete API (injected as paramter to be mocked in testing).
export function postAuthorization(email, password, Api = AuthenticationApi) {
return (dispatch) => {
return Api.postAuthorization(email, password).then(
(response) => {
const token = response.data.token;
localStorage.setItem(`TeamReaderApp_${process.env.NODE_ENV}_token`, token);
dispatch(createSession(token));
dispatch(setLinks({ collection: response.data.links }));
dispatch(loadCategories());
@sebastiandeutsch
sebastiandeutsch / api.js
Created January 8, 2017 01:42
Basic fetch abstraction I use for many of my projects.
import 'whatwg-fetch';
import Config from 'config/Config';
export const corsFetchOptions = {
// Enable cross-domain requests (CORS)
mode: 'cors',
// Send credentials cross-domain
credentials: 'include'
};
@sebastiandeutsch
sebastiandeutsch / Compositional.js
Created January 7, 2017 22:59
Compositional Components to fetch data
<SyncStore loader={TeamLoader} loadingComponent={Loading}>
<TeamReaderApp>
<Match exactly pattern="/" component={LinksIndex} />
<Match pattern='/links' component={LinksIndex} />
<Match pattern='/link/new' component={LinkNew} />
<Match pattern='/link/:id/edit' component={LinkEdit} />
<Match pattern='/categories' component={CategoriesIndex} />
<Match pattern='/category/new' component={CategoryNew} />
<Match pattern='/category/:id/edit' component={CategoryEdit} />
@sebastiandeutsch
sebastiandeutsch / actual.html
Last active October 19, 2016 21:36
I'm trying to implement css modules for haml. I've added a processor for the attributes to archive that: https://github.com/sebastiandeutsch/haml/blob/feature/process_attributes_and_values/lib/haml/compiler.rb#L417. See implementation of the processor below. Now I have the problem that I need to set the context for the processor within a file on…
<div class="test__container___1qISr">
Hello World!
<div class="test__container___1qISr">
Test
</div>
</div>
@sebastiandeutsch
sebastiandeutsch / styles.less
Created October 11, 2016 15:50
atom + operator
atom-workspace, atom-text-editor {
font-family: "Operator Mono";
font-size: 14px;
font-weight: 400;
line-height: 1.7;
}
atom-panel.tool-panel {
font-size: 0.88em;
}
@sebastiandeutsch
sebastiandeutsch / index.js
Created September 30, 2016 10:43
Webpack 1 Resolver Plugin Mechanism
function MyResolverPlugin() {
}
MyResolverPlugin.prototype.apply = function (resolver) {
resolver.plugin("directory", function (request, callback) {
...
});
};
@sebastiandeutsch
sebastiandeutsch / App.js
Created September 6, 2016 22:01
Simple App with two Counters
import React, { Component } from 'react';
import './App.css';
import Counter from './Counter.js';
class App extends Component {
constructor(props) {
super(props);
this.state = {
counter1: 42,
@sebastiandeutsch
sebastiandeutsch / deps-1.js
Created September 1, 2016 12:22
Lots of modules
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.5",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-external-helpers-2": "^6.3.13",
"babel-plugin-react-transform": "^2.0.2",
"babel-plugin-syntax-async-functions": "^6.13.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-plugin-transform-regenerator": "^6.11.4",