Skip to content

Instantly share code, notes, and snippets.

View blattmann's full-sized avatar
🏠
Working from home

Stefan Blattmann blattmann

🏠
Working from home
View GitHub Profile
@blattmann
blattmann / Gruntfile.js
Created May 17, 2017 08:07 — forked from trilodge/Gruntfile.js
Grunt Setup of Stylelint linting SCSS-Files based on postcss-scss and postcss-reporter
var path = require('path');
var fs = require('fs');
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@blattmann
blattmann / Git: Empty branch.md
Last active November 5, 2024 09:06
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@blattmann
blattmann / slackWebhook.md
Created October 24, 2017 21:25 — forked from lakshmantgld/slackWebhook.md
Configuring slack webhook

A Webhook, in simple terms, is a user-defined HTTP callback. It is a mechanism for the system to notify you about an event. In our case, we need to send messages to a particular channel in slack. Slack calls in Incoming Webhook. It is a mechanism to send messages to your Slack Channel from external sources. These external sources could be any application or service that is capable of sending a JSON payload over HTTP into a Slack Channel. Each Channel will be identified by a unique Incoming Webhook URL to which you can post the message from outside. This configuration is done via the Integrations for your channel.

Steps to create a incoming webhook in Slack:

  1. Naviagte to the Incoming Webhook URL. Click the hyper link incoming webhook integration below the heading Incoming Webhooks.
  2. You will be asked to enter your team URL, followed by your slack credentials.
  3. Once you have completed the above step, you will see the wizard kind of webpage to
@blattmann
blattmann / definition-of-done.md
Last active October 11, 2019 06:28
Definition of Done example

Definition of Done

General

  • Full compliant to the given Design Style guide
  • No lintin errors
  • Commit message follows Guidelines
  • Component looks like the designs
  • All the variations of the component are done (e.g. different viewports)
  • There are no @TODOs and commented code except short code information / documentation (only master branch)
@blattmann
blattmann / rebase.md
Last active May 31, 2019 12:16
Rebase workflow Inradius

Rebase workflow in Terminal

$ git fetch
$ git rebase origin/master

If you experience merge conflicts:

@blattmann
blattmann / osx.md
Created May 22, 2019 20:06
Solve OSX issues

restart video camera:

$ sudo killall VDCAssistant

restart mission control / dock:

$ killall Dock

restart wifi service

$ sudo ifconfig en0 up

@blattmann
blattmann / forcedownload.vue
Last active July 19, 2019 10:50
IE11 force download
// Vue.js method to force a file download, in this example a *.jpg
forceDownload(url, fileName) {
const dlFile = fileName || url.substring(url.lastIndexOf('/') + 1);
const mimeType = 'image/jpeg';
const extension = '.jpg';
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
this.trackEvent(url);
@blattmann
blattmann / vuex-module-boilerplate.js
Last active August 16, 2019 06:08
Vuex Module Boilerplate
import axios from 'axios';
const state = {};
const getters = {};
const actions = {};
const mutations = {};
@blattmann
blattmann / ports.md
Created October 21, 2019 09:37
List / Kill used ports on OSX

List a used port, e.g. 4000

$ lsof -i tcp:4000

Kill a used port, e.g. 4000

$ kill $(lsof -ti:4000)
@blattmann
blattmann / mqtt-rf.json
Last active March 26, 2020 19:44
Convert MQTT payloads in Node-RED and Home Assistant
[
{
"id": "4207226e.90885c",
"type": "tab",
"label": "SOS Band",
"disabled": false,
"info": ""
},
{
"id": "dfdca432.7e3a18",