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 | |
function peselValidate(string $str) | |
{ | |
if (!preg_match('/^[0-9]{11}$/', $str)) { | |
return false; | |
} | |
$arrSteps = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3]; | |
$intSum = 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
myApp.config(['$compileProvider', function ($compileProvider) { | |
$compileProvider.debugInfoEnabled(false); | |
}]); |
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 | |
$this->eventStore->beginTransaction(); | |
foreach ($data as $domain => $records) { | |
$aggregate = Domain::create(Uuid::uuid4(), new DomainId($domain)); | |
foreach ($records as $record) { | |
try { | |
$aggregate->addRecord(...); |
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 | |
namespace AppBundle\DBAL\Type; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
use Doctrine\DBAL\Types\Type; | |
final class EncryptedStringType extends Type | |
{ | |
const ENCRYPTED_STRING = 'encrypted_string'; |
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 | |
// form skipped for brevity | |
public function configureOptions(OptionsResolver $resolver) | |
{ | |
$resolver->setDefaults(array( | |
'validation_groups' => function (FormInterface $form) { | |
return $form->getConfig()->getOption('option_name') ? | |
['group1', 'group2'], | |
['group3']; |
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
#!/bin/bash -e | |
gcc dht11_read.c -lwiringPi -o dht11_read |
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
const int sensorPin = 3; | |
const int max_ppm = 2000; | |
long ppm=0; | |
unsigned long duration; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(sensorPin, INPUT); | |
} |
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
#!/bin/bash -e | |
########################################################### | |
# Qmail authentication log analyzer | |
# Detects too many different IP connections in single day | |
# | |
# If anomaly is detected, user account is locked | |
# action is logged and administrator is notified by SMS | |
########################################################### | |
## |
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
#!/bin/sh -e | |
## | |
# Fill this accordingly! | |
# The "server" has to be configured in phpStorm (Settings > Language & Frameworks > PHP > Servers). | |
# Put the name inside the quotes | |
phpstorm_server_name="localhost" | |
## | |
# Put me in bin/ alongside the console script |