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
sub readFile{ | |
my $path = shift; | |
my( $ret, @ret); | |
open( FH, "<".$path); | |
if( wantarray){ | |
push( @ret, $_) foreach( <FH>); | |
}else{ | |
my $retcode = $/; | |
undef( $/); | |
$ret = <FH>; |
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
sub writeFile{ | |
my( $path, $data, $mode) = @_; | |
$mode ? open( FH, ">>".$path) : open( FH, ">".$path); | |
binmode( FH); | |
print FH $data; | |
close( FH); | |
} |
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
sub getModuleVersion { | |
my $name = shift; | |
eval qq|use $name;1;|; | |
return $@ ? undef : eval qq|\$${name}::VERSION|; | |
} |
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
# MyApp.pm | |
package MyApp; | |
use Mojo::Base 'Mojolicious'; | |
use MyApp::Model; | |
has 'model' => sub {MyApp::Model->new}; | |
# MyModel | |
package MyApp::MyModel; | |
use Mojo::Base 'Mojolicious'; |
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
# Custom key mappings | |
map h goBack | |
map l goForward | |
map H previousTab | |
map L nextTab | |
map i LinkHints.activateMode | |
map I LinkHints.activateModeToOpenInNewTab |
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
create user USER_NAME identified by 'password'; | |
grant all privileges on DB_NAME.* to 'USER_NAME'@'%'; |
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
#!/bin/bash | |
sudo yum -y install epel-release | |
sudo yum -y install haskell-platform --enablerepo=epel | |
cabal update | |
cabal install pandoc --force-reinstall |
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
# https://github.com/neovim/neovim/wiki/Installing-Neovim | |
yum -y install epel-release | |
curl -o /etc/yum.repos.d/dperson-neovim-epel-7.repo https://copr.fedorainfracloud.org/coprs/dperson/neovim/repo/epel-7/dperson-neovim-epel-7.repo | |
yum -y install neovim --enablerepo=epel |
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
useradd -m -g developer user | |
echo "password" | passwd user --stdin | |
(echo "password"; echo "password") | smbpasswd -s -a user |
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
docker run -it --name=cakephp centos:centos7.2.1511 /bin/bash | |
yum -y install mariadb-server | |
yum -y install epel-release | |
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm | |
yum -y install --enablerepo=remi,remi-php72 php php-mbstring php-mysql php-gd |
OlderNewer