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 issues = $$('.markdown-title'); | |
var content = ""; | |
for (i in issues) { | |
content = content + "+ User: fix - " +issues[i].text + "\n"; | |
} | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", content); | |
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
## Pros and Cons of fat controller | |
### Pros | |
+ Fast dev time, no extra layer | |
### Cons | |
+ No reusable code for different interfaces (API, CLI and Controller) | |
## Pros and Cons of fat service class |
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
<?= $this->Form->create($entry); ?> | |
<?= | |
$this->Form->input('emy_contact_no.code', [ | |
'options' => ['1' => 1, '2' => 2], | |
'empty' => 'Select', | |
'class' => 'form-control', | |
'label' => false, | |
]) | |
?> |
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 App\Controller; | |
use Cake\Event\Event; | |
use Cake\ORM\TableRegistry; | |
use Cake\Utility\Hash; | |
class RegistrationController extends AppController | |
{ |
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 | |
class KeyGenerator | |
{ | |
public static function fromLabels(array $labels) | |
{ | |
if (empty($labels)) { | |
return []; | |
} |
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 | |
# Shell script to backup MySql database | |
# CONFIG - Only edit the below lines to setup the script | |
# =============================== | |
MyUSER="root" # USERNAME | |
MyPASS="password" # PASSWORD | |
MyHOST="localhost" # Hostname |
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
return array_map(function ($c, $serializedTicket) { | |
$ticket = unserialize($serializedTicket); | |
return [ | |
'id' => $ticket->get('id'), | |
'name' => $ticket->get('name'), | |
'amt' => $this->toDollarFormat($ticket->get('price')->toCent()), | |
'qty' => $c | |
]; |
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
array_map('unserialize', array_unique(array_map('serialize', $input))); |
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
$oDateNow = new DateTime(); | |
$oDateBirth = new DateTime($sDateBirth); | |
$age = $oDateNow->diff($oDateBirth)->y; | |
// its take day into consideration |
NewerOlder