This file contains 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
#!/usr/bin/env bash | |
# Using bento/ubuntu-14.04 vm box and Vagrant v1.9.8 | |
# Corresponding line in Vagrantfile: config.vm.provision "shell", path: "bash-it.sh", privileged: false | |
# https://github.com/Bash-it/bash-it | |
# https://www.vagrantup.com | |
export DEBIAN_FRONTEND=noninteractive | |
# Clonning bash-it repo |
This file contains 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
function dashToCamelCase( myStr ) { | |
return myStr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); | |
} | |
var myStr = dashToCamelCase( 'this-string' ); | |
alert( myStr ); // => thisString |
This file contains 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
function camelCaseToDash( myStr ) { | |
return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
} | |
var myStr = camelCaseToDash( 'thisString' ); | |
alert( myStr ); // => this-string |
OlderNewer