Bioshock – Remove Intro Videos (Steam)

Bioshock Remastered – Updated Graphics, but same old stupid multiple unskippable 2k Intro Video. Great…

To avoid waiting for ages to get the stupid game going. You can add a the flag -nointro to the launch options.

  1. Right-click on the game in the steam library and select “Properties”
  2. Then click on the button “Set Launch Options”
  3. Add the flag “-nointro”

Udacity – Web Tooling and Automatisation

I recently took a look at the course materials for Web Tooling and Automatisation.

Overall the course is very well structured and introduces Gulp and a couple of common packages used in web development. Besides their main topic, they cover topics on good engineering practices, like linting and testing to ensure code quality.

While working on the project I ran into several little smaller things that were quite annoying. Thankfully the gulp community is quite big, so somebody already solved some of the issues I was facing.

Passing an “–production” flag

When developing, you will probably create a version of your software that is suited for easily finding bugs and errors and an optimized version that is minified and optimized for optimal performance for the end user.

You would define two different tasks in gulp, one “default” and one “production” task. This, however, would, in turn, cause you to have to duplicate your code – with optimization and without.

I found the package “gulp-if” that allows you to control if a function like compression is active during the task. The remaining issue was to actually set the parameter before the tasks run. (All tasks in gulp run in parallel).

To get a flag from the command line, you can use the process.argv Array. However, you must add “–” before your flag name. If not gulp will assume it is another task name that should run.

In the end, you would use something like this:

//Enable Production Flag
var production = (process.argv.indexOf("--production") !== -1);

//Use in task

gulp.task("default", ()=>{
.pipe(gulpif(production, foo())
**Note:** In Gulp 4, you can use a sequencer and would not need to pass in the flag by command-line, but you would define a task that will run before all the other tasks.

# Dealing with Asset sources and destinations
When using gulp.src() and gulp.dest(), typically people use strings to define the locations. However, this is quite annoying if you want to get a quick overview which locations are used. For a better maintainability, you should create a small variable block that defines these strings. In the long run, it lets you be more flexible where your files are etc.
<pre class="lang:js decode:true ">//Path Definitions
const htmlPaths = {
    src: "src/views/**/*.pug",
    dest: "dist"

gulp.task("html", () => {

End Result

At the end of the course, I ended up with this gulpfile.js. It adds support for Typescript, Pug(Jade), google-closure-compiler.

The common gulp tasks to run are:

  • gulp serve: Uses browser-sync with CSS injection for live-editing
  • gulp --production: Creates an optimized build

Next steps: Depending on your web server, you would want to add a gulp deploy task.


//Gulp Packages
const gulp = require('gulp');
const gulpif = require('gulp-if');
const browserSync = require('browser-sync').create();

const pug = require("gulp-pug");

const imagemin = require('gulp-imagemin');

const sass = require("gulp-sass");
const autoprefixer = require("gulp-autoprefixer");

const ts = require("gulp-typescript");
const eslint = require("gulp-eslint");
const closureCompiler = require('google-closure-compiler').gulp();

const jasmine = require("gulp-jasmine-phantom")

//Flag Definitions
var production = (process.argv.indexOf("--production") !== -1);

//Path Definitions
const htmlPaths = {
    src: "src/views/**/*.pug",
    dest: "dist"

const stylesPaths = {
    src: "src/styles/**/*.scss",
    dest: "dist/styles"

const scriptsPaths = {
    src: "src/scripts/**/*.ts",
    dest: "dist/scripts"

const imgPaths = {
    src: "src/img/*",
    dest: "dist/img"  

//Task Definitions
gulp.task("default", ["html", "scripts", "styles", "images"]);

gulp.task("serve", ["default"], () => {
        server: "./dist"
    });, ["styles"]);, ["scripts"]);, ["images"]);, ["html"]).on('change', browserSync.reload);

gulp.task("html", () => {

gulp.task("scripts", () => {
            out: "output.js"
            parser: "typescript-eslint-parser"
        .pipe(gulpif(production, closureCompiler({
            compilation_level: 'SIMPLE',
            warning_level: 'VERBOSE',
            language_in: 'ECMASCRIPT6_STRICT',
            language_out: 'ECMASCRIPT5_STRICT',
            output_wrapper: '(function(){\n%output%\n}).call(this)',
            js_output_file: 'output.min.js'

gulp.task("styles", () => {
    let sassOptions = {};
    if (production) {
        sassOptions = {
            outputStyle: 'compressed'
        .pipe(sass(sassOptions).on('error', sass.logError))
            browsers: ['last 2 versions']

gulp.task("tests", () => {
            integration: true,
            vendor: '_build/**/*.js'

gulp.task("images", () => {


  "name": "udacity-webtooling",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "browser-sync": "^2.18.7",
    "eslint": "^3.15.0",
    "eslint-config-google": "^0.7.1",
    "google-closure-compiler": "^20170124.0.0",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^3.1.1",
    "gulp-eslint": "^3.0.1",
    "gulp-if": "^2.0.2",
    "gulp-imagemin": "^3.1.1",
    "gulp-jasmine-phantom": "^3.0.0",
    "gulp-pug": "^3.2.0",
    "gulp-sass": "^3.1.0",
    "gulp-tslint": "^7.1.0",
    "gulp-typescript": "^3.1.4",
    "phantomjs": "^2.1.7",
    "tslint": "^4.4.2",
    "typescript": "^2.1.6",
    "typescript-eslint-parser": "^1.0.3"


ImageDesigned by Freepik

NPM: Use Github Patch Instead of Repository

Recently I was playing around with the HEXO static site generator. For my setup, I was using Hexo in combination with Gitlab CI and the ftp deploy method.

The module hexo-deployer-ftpsync has an issue that you need to manually confirm that the FTP deployment succeeded. In essence, it does not exist on its own, thus a CI environment would not be able to automatically verify the success or failure of the build, it would just run forever.

Github allows you to fork existing code, improve upon it and issue a pull request, that your code will be integrated into the main software build. I changed a couple of lines to ensure that the FTP deploy process would terminate.

To use my patch instead of the current master build of the module you need to adjust the package.json file. Simply replace the version-number with the github url <username/project>#

Original: With Version Number

  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-deployer-ftpsync": "^0.1.1",

New: With github path to patch

  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-deployer-ftpsync": "borgfriend/hexo-deployer-ftpsync#80b51f3",

If the owner of the project integrates my suggestion on how to fix the bug, then the line can be changed back to the official master branch of the code. However, for the time being, gitlab CI uses the alternative code and successfully deploys my code to the server.

Image: Designed by Freepik