Skip to content

Instantly share code, notes, and snippets.

View lamosty's full-sized avatar

Rastislav Lamos lamosty

View GitHub Profile
@lamosty
lamosty / packages.json
Last active October 26, 2015 14:29
package.json file from the Lexi WordPress theme: https://github.com/lamosty/lexi/blob/master/package.json
{
"name": "Lexi-WP-Theme",
"version": "0.0.1",
"description": "",
"license": "MIT",
"dependencies": {
"history": "^1.9.0",
"isomorphic-fetch": "^2.1.1",
"react": "^0.14.0-rc1",
@lamosty
lamosty / webpack.config.js
Created October 26, 2015 14:28
webpack.config.js file from the Lexi WordPress theme: https://github.com/lamosty/lexi/blob/master/webpack.config.js
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
@lamosty
lamosty / server.js
Created October 26, 2015 15:57
server.js file from the Lexi WordPress theme: https://github.com/lamosty/lexi/blob/master/server.js
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: {
colors: true
@lamosty
lamosty / index.template.html
Created November 9, 2015 14:07
Template file for the HTML Webpack Plugin. From the tutorial about React WP Theme: https://lamosty.com/2015/11/react-wp-theme-bootstrap-blog-to-react-components-router
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
@lamosty
lamosty / index.js
Created November 9, 2015 14:15
Main file for the Lexi WP theme, from the tutorial about React WP theme: https://lamosty.com/2015/11/react-wp-theme-bootstrap-blog-to-react-components-router
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute } from 'react-router';
import configureStore from './store/configureStore';
import LexiTheme from './containers/LexiTheme';
import ArticlePage from './containers/ArticlePage';
import ArticleListingPage from './containers/ArticleListingPage';
import AboutPageContainer from './containers/AboutPageContainer';
@lamosty
lamosty / Header.js
Created November 23, 2015 16:22
Header dumb component from the Lexi React WP theme: https://github.com/lamosty/lexi/blob/master/src/components/Header.js
import React, { Component } from 'react';
export default class Header extends Component {
render() {
return (
<div className="blog-header">
<div className="container">
<h1 className="blog-title">The Bootstrap Blog</h1>
<p className="lead blog-description">An example blog template built with Bootstrap.</p>
</div>
@lamosty
lamosty / MainNavigation.js
Created December 14, 2015 14:38
MainNavigation dumb component from the Lexi React WP theme: https://github.com/lamosty/lexi/blob/master/src/components/MainNavigation.js
import React, { Component } from 'react';
import { Link } from 'react-router';
export default class MainNavigation extends Component {
render() {
return (
<div className="blog-masthead">
<div className="container">
<nav className="nav blog-nav">
<Link to="/" className="nav-link" activeClassName="active" onlyActiveOnIndex={true}>Home</Link>
@lamosty
lamosty / AboutPage.js
Last active December 14, 2015 15:19
AboutPage dumb component from the Lexi React WP theme: https://github.com/lamosty/lexi/blob/master/src/components/AboutPage.js
import React, { Component } from 'react';
// Dumb component
export default class AboutPage extends Component {
createMarkup(html) {
return {
__html: html
}
}
@lamosty
lamosty / how-to-code-vim-commands.md
Last active October 20, 2018 13:32
How to code in Vim — Commands, a video tutorial on Youtube: https://www.youtube.com/watch?v=hax7BEobOJQ

Command (normal) mode:

File

  • :w - save file
  • :q - close file
  • :q! - close file without saving
  • :x - save and close

Navigation

  • h - left