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 / 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 / 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 / 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 / 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 / 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 / Git: Empty branch.md
Last active December 18, 2025 11:15
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 / 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 / gist:6e06f1a313fcdeef4646b96125d5863d
Created March 1, 2017 19:52 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@blattmann
blattmann / js
Last active February 3, 2017 09:35
angularjs-gulp-example
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
del = require('del'),
sass = require('gulp-sass'),
karma = require('gulp-karma'),
jshint = require('gulp-jshint'),
sourcemaps = require('gulp-sourcemaps'),
spritesmith = require('gulp.spritesmith'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),