grunt setup

grunt setup for web projects. package.json { “name”: “package”, “version”: “0.0.1”, “dependencies”: { “grunt”: “^1.0.1” }, “devDependencies”: { “grunt-autoprefixer”: “^3.0.4”, “grunt-contrib-concat”: “^1.0.1”, “grunt-contrib-sass”: “^1.0.0”, “grunt-contrib-uglify”: “^3.1.0”, “grunt-contrib-watch”: “^1.0.0” }, “license”: “ISC” } Gruntfile.js module.exports = function (grunt) { grunt.initConfig({ watch: { scss: { files: ‘assets/css/*.scss’, tasks: [‘concat’, ‘sass’, ‘autoprefixer’] } Read more…

install mongodb for php7

sudo apt-get install php7.0-dev ## if apt-get is unable to finde the package # sudo apt-get install ppa-purge # sudo ppa-purge ppa:ondrej/php-7.0 # sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php # sudo apt-get update # sudo apt-get install php7.0-dev pecl -v ## if you see warnings like “unable to find pdo_mysql.so” etc. reinstall Read more…

mysqldump – sichern und einspielen

Kommando zum Sichern aller Datenbanken mysqldump -u[user] -p[password] –all-databases > backup.sql Und speziell für Windows Maschinen mysqldump -u[user] -p[password] –all-databases -r backup.sql http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_result-file Sichern einer bestimmten Datenbank mysqldump -u[user] -p[password] [databasename] > backup.sql Kommando zum Einspielen der Sicherung: komplette Sicherung mysql -u[user] -p[password] < backup.sql Kommando zum Einspielen der Sicherung: Read more…

jslint / jshint – my notes

global browser variables, window, document … /*jslint browser: true*/ suppress linting for jQuery ($) /*global $:false*/ suppress linting for unused params /*jslint unparam: true*/ // statement /*jslint unparam: false*/ suppress linting for new operator /*jshint nonew: false*/ suppress linting for ++ operator /*jslint plusplus: true */   A Comparison of Read more…

create and share a vagrant box

Info and upload: https://atlas.hashicorp.com/help/vagrant/boxes/create Pack a box with virtualbox vagrant package –base <virtual_maschine_name> –output mybox.box Avoid the generation of a ssh key! Insert this into your Vagrantfile  during box creation config.ssh.insert_key=false Remove an existing ssh key from a box wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -O .ssh/authorized_keys chmod 700 .ssh chmod 600 .ssh/authorized_keys chown Read more…

force www for http and https

RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Found here: http://stackoverflow.com/questions/4916222/htaccess-how-to-force-www-in-a-generic-way

creating a vagrant base box from an existing base box

A vagrant Ubuntu Server 32bit 14.04 LTS with Apache, MySQl, PHP and several development tools installed. The server contains the following components: apache mysql php 5.5 sqlite vim git composer nodejs, npm cUrl xdebug The result can be used here: https://atlas.hashicorp.com/alexwenzel/boxes/webdev Prepare the server Initzialize vagrant: vagrant init ubuntu/trusty32 Edit the initial vagrant Read more…

Git

Installation und Konfiguration apt-get install git git config –global user.name “John Doe” git config –global user.email johndoe@example.com Git Befehle Tags löschen: git tag -d v1.0 git push origin :refs/tags/v1.0 Remote branch löschen: -d = löschen -D = löschen erzwingen git branch -d branchname git push origin :branchname Tag auschecken: git Read more…