Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathias Vagni mattvagni

View GitHub Profile
View foo.jsx
import React from "react";
import Recipe from "./recipe";
export default function recipeTemplate(props) {
console.log(props)
return (
<section>
<Recipe
title={props.pageContext.recipe.title}
View gist:6e27bf5fdd2b57a74466f8f04be52dd3
Theme:
https://marketplace.visualstudio.com/items?itemName=whizkydee.material-palenight-theme
#-------------------------------------------------------------------------------
# Make the default prompt with our custom colors
#-------------------------------------------------------------------------------
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
@mattvagni
mattvagni / .bash_profile
Last active Jun 5, 2017
ma bash_profile
View .bash_profile
#-------------------------------------------------------------------------------
# Make the default prompt with our custom colors
#-------------------------------------------------------------------------------
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
@mattvagni
mattvagni / syntax-highlighting-jsx-jekyll-example.scss
Last active May 31, 2017
Syntax highlighting theme which works for JSX in Jekyll, Pygmentize etc.
View syntax-highlighting-jsx-jekyll-example.scss
$color00: #1B2B34;
$color01: #CDD3DE;
$color02: #93a1a1;
$color03: #99C794;
$color04: #EC5F67;
$color05: #FAC863;
$color06: #C594C5;
$color07: #6699CC;
$color08: #b58900;
View watch-for-changes.js
"scripts": {
"build:client": "webpack --config webpack.config.js",
"build:server": "BABEL_ENV=server babel src --out-dir ./build/server",
"watch:client": "npm run build:client -- --watch",
"watch:server": "npm run build:server -- --watch"
}
View prefixed-css.css
._6de768fc {
display: -webkit-flex;
display: -ms-flexbox;
display: flex; }
._8e1229bd {
color: red; }
._8e1229bd :hover {
color: green; }
View postcss-config.js
const autoprefixer = require('autoprefixer');
module.exports = {
plugins: [
autoprefixer({
browsers: [
'last 2 versions',
'IE >= 9',
'safari >= 8'
]
View webpack-css-postcss-loader.js
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
loader: [
{
loader: 'css-loader',
query: {
localIdentName: '[hash:8]',
modules: true
}
View server-build-with-sass.js
'use strict';
var _styles = {
'wrapper': '_6de768fc',
'button': '_8e1229bd'
};
var _styles2 = _interopRequireDefault(_styles);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
View sass-loader.js
const sass = require('node-sass');
module.exports = (data, file) => {
try {
return sass.renderSync({data, file}).css.toString('utf8');
} catch (e) {
console.error(e);
}