Skip to content

Instantly share code, notes, and snippets.

Daniel Schäfer epegzz

Block or report user

Report or block epegzz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@epegzz
epegzz / MyComponent.js
Last active Oct 22, 2017
CSS inline styles, CSS Modules, ReactRouter 2
View MyComponent.js
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import styles from './MyComponent.scss';
function MyComponent(props, context) {
return (
<div className="my-component-container">
<h1 className="my-component-title">Hello, world!</h1>
<div className="my-component-body">
Here goes some more text…
@epegzz
epegzz / MyComponent.css
Created Oct 22, 2017
CSS inline styles, CSS Modules, ReactRouter 2
View MyComponent.css
.my-component-container { padding: 10px; }
.my-component-title { color: "red"; font-size: 24px; }
.my-component-body { font-size: 15px; }
@epegzz
epegzz / MyComponent.js
Last active Oct 22, 2017
CSS inline styles, CSS Modules, ReactRouter 2
View MyComponent.js
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import styles from './MyComponent.scss';
function MyComponent(props, context) {
return (
<div className={styles.container}>
<h1 className={styles.title}>Hello, world!</h1>
<div className={styles.body}>
Here goes some more text…
@epegzz
epegzz / MyComponent.css
Last active Oct 22, 2017
CSS inline styles, CSS Modules, ReactRouter 2
View MyComponent.css
.container { padding: 10px; }
.title { color: "red"; font-size: 24px; }
.body { font-size: 15px; }
@epegzz
epegzz / server.js
Last active Oct 22, 2017
CSS inline styles, CSS Modules, ReactRouter 2
View server.js
import express from 'express';
import ReactDOM from 'react-dom';
import router from './router.js';
const server = express();
// Server-side rendering of the React app
server.get('*', (req, res, next) => {
const css = new Set();
// The context.insertCss() function will be called by `withStyles`
View unix tricks you should be using
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg
You can’t perform that action at this time.