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
#!/usr/bin/perl | |
use Data::Dumper; | |
my $loadAvgLast15Minutes = `uptime | awk '{gsub(",",""); print \$9}'`; | |
my $memoryUsed = `free | awk '/Mem/ {print \$3}'`; | |
# Assume its 16 cores cpu and has 16gb ram | |
if ($loadAvgLast15Minutes > 14 && $memoryUsed > 11524884) { | |
print '5 minute load avarage is greater than 85% and memory usage is greater than 70%'; |
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
<?php | |
require 'vendor/autoload.php'; | |
$form = new \Form\Builder(); | |
$options_list = [0 => '-- Select --', 1 => 'Bachelor Degree', 2 => 'Master Degree']; | |
?> | |
<?php echo $form->open(['action' => '/form-handler']); ?> | |
<legend>Form Builder Example</legend> | |
<div class="form-group"> |
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
// Sweeps out all the unwanted .svn files recursively from repo with one go | |
find myproject -name ".svn" -exec rm -rf "{}" \; | |
// finds all the files with word class in them recursively | |
// --with-filename option prints the file name | |
find myproject -exec grep --with-filename class {} \; |
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
$_fp = fopen("php://stdin", "r"); | |
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ | |
$count = fgets($_fp); | |
while ( $value = fgetcsv($_fp,0,' ')){ | |
$cases[] = $value; | |
} |
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
public function register() | |
{ | |
$this->app['command.hello'] = $this->app->share(function($app){ | |
return new HelloCommand; | |
}); | |
$this->commands('command.hello'); | |
} |