Skip to content

Instantly share code, notes, and snippets.

Avatar

Rastislav Lamos lamosty

View GitHub Profile
@lamosty
lamosty / packages.json
Last active Oct 26, 2015
package.json file from the Lexi WordPress theme: https://github.com/lamosty/lexi/blob/master/package.json
View packages.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",
View 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 Nov 9, 2015
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
View index.template.html
<!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 Nov 9, 2015
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
View index.js
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';
View 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>
View 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>
View AboutPage.js
import React, { Component } from 'react';
// Dumb component
export default class AboutPage extends Component {
createMarkup(html) {
return {
__html: html
}
}
View 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 / how-to-code-vim-commands.md
Last active Oct 20, 2018
How to code in Vim — Commands, a video tutorial on Youtube: https://www.youtube.com/watch?v=hax7BEobOJQ
View how-to-code-vim-commands.md

Command (normal) mode:

File

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

Navigation

  • h - left