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 App\Security; | |
| use Firebase\JWT\JWT; | |
| use Firebase\JWT\SignatureInvalidException; | |
| use Symfony\Component\Cache\Adapter\AbstractAdapter; | |
| use Symfony\Component\Cache\Adapter\ApcuAdapter; |
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
| /** Checks if the JWT is present and not expired | |
| The token is expected to be found in `token` environment variable | |
| */ | |
| function isValidToken() { | |
| const token = pm.environment.get("token"); | |
| if (!token) { | |
| console.log("Token is missing"); | |
| return false; | |
| } | |
| // Payload is retrieved after JSON parsing the base64 decoded `atob()` 2nd part of the JWT `[1]` |
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 AdminBundle\Form; | |
| use Symfony\Component\Form\AbstractType; | |
| use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |
| use Symfony\Component\OptionsResolver\OptionsResolver; | |
| use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; | |
| use Symfony\Component\Security\Core\Role\Role; |
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 | |
| /** | |
| * @param string|array $dottedParts | |
| * @param string $parent | |
| * @return array | |
| */ | |
| public function getJoinsFromDottedPath($dottedParts, $parent = 'entity') | |
| { | |
| if (!is_array($dottedParts)) { | |
| // Assuming the $dottedParts is a 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
| - (void)listSubviewsOfView:(UIView *)view { | |
| [self listSubviewsOfView:(UIView *)view withPrefix:@""]; | |
| } | |
| - (void)listSubviewsOfView:(UIView *)view withPrefix:(NSString *)prefix { | |
| NSArray *subviews = [view subviews]; | |
| for (UIView *subview in subviews) { | |
| NSLog(@"%@ %@ (%d %d; %d %d)", prefix, subview.class | |
| , (int)subview.frame.origin.x | |
| , (int)subview.frame.origin.y | |
| , (int)subview.frame.size.width |
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
| from fabric.api import * | |
| from fabric.colors import green | |
| env.hosts = ['my_user@my_host'] | |
| env.password = 'my_password' | |
| env.app_path = 'my/app/path' | |
| def commit(): | |
| print(green("Commit last modifs...")) | |
| local('git add -A && git commit') |
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
| /* | |
| * CakePHP Twitter Bootstrap Typeahead with id | |
| * ProjectsController.php | |
| * <?php $this->set('projects', $this->Project->find('list'); $this->render('list', 'ajax'); ?> | |
| * /app/View/Projects/list.ctp | |
| * <?php echo json_encode($projects); ?> | |
| * data = {'id': 'item name', ..}; | |
| * /app/View/Tasks/index.ctp | |
| * <input type="hidden" id="TaskProjectId" name="data[Task][project_id]"/> | |
| * <input autocomplete="off" data-provide="typeahead" class="typeahead" type="search" id="TaskProject"> |