Skip to content

Instantly share code, notes, and snippets.

View HoverBaum's full-sized avatar
🌳
 I like 🌳🌳🌳 

Hendrik HoverBaum

🌳
 I like 🌳🌳🌳 
View GitHub Profile
@HoverBaum
HoverBaum / .travis.yml
Created August 11, 2016 03:19
Deploy Hexo blog using Travis.
# Deploy hexo site by travis-ci
# https://github.com/jkeylu/deploy-hexo-site-by-travis-ci
# LICENSE: MIT
#
# 1. Copy this file to the root of your repository, then rename it to '.travis.yml'
# 2. Replace 'YOUR NAME' and 'YOUR EMAIL' at line 29
# 3. Add an Environment Variable 'DEPLOY_REPO'
# 1. Generate github access token on https://github.com/settings/applications#personal-access-tokens
# 2. Add an Environment Variable on https://travis-ci.org/{github username}/{repository name}/settings/env_vars
# Variable Name: DEPLOY_REPO
@HoverBaum
HoverBaum / loggingMiddleware.js
Created July 20, 2016 02:40
Logging middleware for Redux.
/*
Logging middleware for Redux as suggested by the official documentation.
http://redux.js.org/docs/advanced/Middleware.html
*/
export const logger = store => next => action => {
console.log('dispatching\n', action)
let result = next(action)
console.log('next state\n', store.getState())
return result
@HoverBaum
HoverBaum / webpack.config.js
Created July 19, 2016 07:43
Basic webpack file for ReactJS based proejcts.
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: {
main: "./src/js/index.js"
},
output: {
path: path.join(__dirname, 'build', 'js'),
filename: "[name].js"
@HoverBaum
HoverBaum / findFiles.js
Created July 4, 2016 02:22
Asynchronously find all files matching a filter in a directory using node.
/**
* Walks a filestructure starting from a given root and returns all found files to a callback, using a filter.
* @param {String} dir - Root directory
* @param {RegEx} filter - RegEx to test found files against
* @param {Function} done - Callback will be called with (err, foundFiles)
* @private
*/
function walk(dir, filter, done) {
var results = [];
fs.readdir(dir, function(err, list) {
@HoverBaum
HoverBaum / JSSyntax.js
Last active June 23, 2016 06:51
An example of JavaScript syntax for code highlighters.
/*
This file is build to have somehting to paste into code highlighters or editors and see how they display JavaScript.
It therefor includes many random things you might do in JS.
*/
function hello() {
var hello = 'hello'
let world = "world"
const helloWorld = hello + ` ${world}`
return(helloWorld)
@HoverBaum
HoverBaum / modular-headers.styl
Created June 23, 2016 01:43
Calculate modular scalled font-sizes for headlines in Stylus
/*
Calculate modular scalled font-sizes for headlines in Stylus
"Modular scale refers to a series of harmonious numbers
that relate to one another in a meaningful way."
Inspired after reading http://typographyhandbook.com/#font-sizing
Build after http://www.modularscale.com/
*/
@HoverBaum
HoverBaum / hideScrollbar.less
Created June 1, 2016 01:42
Atom: hide scrollbars
/*
Hide scrollbars when not hovering container in Atom.
For Windows especially.
Get those scrollbars out of your way.
Put this in your 'style.less'.
Open Settings click 'Open config folder'
This was really getting to me, thanks for
@HoverBaum
HoverBaum / ICEProject Standard.md
Last active May 31, 2016 01:44
Thinking about a coding standard for iceproject.

I.C.E. Project

This document strives to provide coding guidelines and standard to use in the iceproject.

At the same time it serves as the "must read" introduction for people new to the project.

General Filestructure

.
@HoverBaum
HoverBaum / React with Webpack.md
Last active May 24, 2016 02:18
Webpack setup for React projects

Developing react based applications using webpack

Since this just took me a day to get to work. Let me tell you how I did it.

My filestructure for this looks like this:

.
├── package.json
├── src
│   ├── js
@HoverBaum
HoverBaum / .gitlab-ci.yml
Created May 20, 2016 09:12
Gulpfile and gitlab CI config to go with my Hexo based blog.
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install -g gulp
- npm install