This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Yeoman Commands | |
# Install new generator | |
npm install -g yo generator-[nameOfGenerator] | |
# Uninstall generator | |
npm uninstall -g yo generator-[nameOfGenerator] | |
# Example | |
npm install -g generator-angular # install generator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: http://coding.smashingmagazine.com/2013/11/12/an-introduction-to-dom-events/ | |
var element = document.getElementById('element'); | |
function callback() { | |
alert('Hello'); | |
} | |
// Add listener | |
element.addEventListener('click', callback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#menu li').each(function(index) { $(this).click(function() { | |
$('#menu li').removeClass('active'); | |
$('#menu li:eq(' + index + ')').addClass('active'); }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r --cached . | |
git add . | |
git commit -m "fixing .gitignore" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r --cached . | |
git add . | |
git commit -m "fixing .gitignore" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For test | |
$ for filename in IMG_*; do echo mv \"$filename\" \"${filename//IMG_/Fireworks}\"; done | |
# for rename files | |
$ for filename in IMG_*; do echo mv \"$filename\" \"${filename//IMG_/Fireworks}\"; done | /bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> ffmpeg -i video.mp4 -vcodec libvpx-vp9 -strict experimental output.webm | |
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers | |
built on Jan 2 2014 22:34:47 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 48.101 / 52. 48.101 | |
libavcodec 55. 39.101 / 55. 39.101 | |
libavformat 55. 19.104 / 55. 19.104 | |
libavdevice 55. 5.100 / 55. 5.100 | |
libavfilter 3. 90.100 / 3. 90.100 | |
libavresample 1. 1. 0 / 1. 1. 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> ffmpeg -encoders | |
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers | |
built on Jan 2 2014 22:34:47 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 48.101 / 52. 48.101 | |
libavcodec 55. 39.101 / 55. 39.101 | |
libavformat 55. 19.104 / 55. 19.104 | |
libavdevice 55. 5.100 / 55. 5.100 | |
libavfilter 3. 90.100 / 3. 90.100 | |
libavresample 1. 1. 0 / 1. 1. 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var templateSource = './template.conf', | |
templateDestination = './new-file.conf', | |
templateParameters = { | |
domainBody: 'pavelbinar', | |
domainExtension: '.cz' | |
}; | |
var editTemplate = function (srcPath, destPath, replacements) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var wwwDir = './'; | |
//var wwwDir = '/var/www'; | |
var apacheDir = './apache2'; | |
//var apacheDir = '/etc/apache2'; | |
domainBody = process.argv[2]; | |
domainExtension = process.argv[3]; |