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
var hourRegex = /([0-9]+):([0-9][0-9]):([0-9][0-9])/; | |
$("div").each(function(){ | |
var matches =$(this).clone().children().remove().end().text().match(hourRegex); | |
if(matches && matches.length){ | |
var decimal = parseInt(matches[1]); | |
decimal+= parseInt(matches[2])/60; | |
decimal+= parseInt(matches[3])/3600; | |
$(this).append("("+decimal.toFixed(2)+")"); | |
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
<?php | |
// Generate the start timestamp | |
$start = time(); | |
// Do other stuff.... | |
// If the end timestamp is over 7 weeks in seconds throw an error | |
if( strtotime('+7 days') - $start > 86400) { | |
throw new \Exception('must be less than 7 weeks'); | |
} |
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
<?php | |
namespace Example\Doctrine\Util; | |
use Doctrine\ORM\Query; | |
class QueryUtils | |
{ | |
/** | |
* @param Query $query | |
* @return array An array with 3 indexes, sql the SQL statement with parameters as ?, params the ordered parameters, and paramTypes as the types each parameter is. |
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
my-logs/2016/09/14/23/MyApp.1473894000059:15674:abcefawed27be2305c30049c48552f8c46673340,2016-09-14 19:59:11 | |
my-logs/2016/09/14/23/MyApp.1473894000059:15675:efwefwef8ce2b4bca75d8e00b8100815d9e2838b,2016-09-14 19:59:11 | |
my-logs/2016/09/14/23/MyApp.1473894000059:15679:8b0cdwewewewed0831b4aa0e023f4874fc0f5799,2016-09-14 19:59:11 | |
my-logs/2016/09/14/23/MyApp.1473894000059:15680:c5b4d66b9c30eeeeeeeea5b3d6b566877b2216dd,2016-09-14 19:59:11 |
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
22 Sep 2016 09:59:18 [INFO] my-logs/2016/09/14/23/MyApp.1473894000059:15674:abcefawed27be2305c30049c48552f8c46673340,2016-09-14 19:59:11 | |
22 Sep 2016 09:59:18 [INFO] my-logs/2016/09/14/23/MyApp.1473894000059:15675:efwefwef8ce2b4bca75d8e00b8100815d9e2838b,2016-09-14 19:59:11 | |
22 Sep 2016 09:59:18 [INFO] my-logs/2016/09/14/23/MyApp.1473894000059:15679:8b0cdwewewewed0831b4aa0e023f4874fc0f5799,2016-09-14 19:59:11 | |
22 Sep 2016 09:59:18 [INFO] my-logs/2016/09/14/23/MyApp.1473894000059:15680:c5b4d66b9c30eeeeeeeea5b3d6b566877b2216dd,2016-09-14 19:59:11 |
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
s3.access_key=XXXX | |
s3.secret_key=YYYY | |
s3.bucket=my-bucket | |
search_term=my_search | |
is_regex_search=false | |
log_level=INFO | |
logger_pattern=%d{dd MMM yyyy HH:mm:ss} [%p] %m%n |
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
java -jar s3-grep-1.0-SNAPSHOT.jar s3grep.properties. |
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
<?php | |
$items = $em->getRepository('AppBundle:ExampleEntity')->findAll(); | |
foreach($items as $i){ | |
$c = new \ReflectionClass("AppBundle\\Entity\\ExampleEntity"); | |
$prop = $c->getProperty('visible_label'); | |
$prop->setAccessible(true); | |
$i->translate('en')->setVisibleLabel($prop->getValue($i)); | |
$i->mergeNewTranslations(); | |
} |
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 TABLE `example_entity` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; | |
CREATE TABLE IF NOT EXISTS `example_entity_translation` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`translatable_id` int(11) DEFAULT NULL, | |
`visible_label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, |
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 TABLE `example_entity` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`visible_label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; |
NewerOlder