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
//reference http://hasin.me/2013/10/27/how-to-login-a-user-programatically-in-symfony2/ | |
//... | |
class UserController extends FOSRestController implements ClassResourceInterface { | |
//... | |
/** | |
* Authenticate a user with Symfony Security | |
* |
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_once __DIR__.'/../../../../../../../app/AppKernel.php'; | |
class ContainerTestCase extends WebTestCase { | |
private $container; | |
public function setUp() { | |
$this->app = new \AppKernel('test', true); |
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
function the_breadcrumb() { | |
global $post; | |
//var_dump($post); | |
echo '<ol class="breadcrumb" id="breadcrumbs">'; | |
if (is_front_page() && !is_home()) { | |
echo '<li><a href="'; | |
echo get_option('home'); | |
echo '">'; | |
echo _e('Home'); |
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 | |
//show just X posts for custome type | |
function modify_num_posts_for_clients($query) { | |
if ($query->is_main_query() && $query->is_post_type_archive('client') && !is_admin()) { | |
$query->set('posts_per_page', -1); | |
} | |
} | |
add_action('pre_get_posts', 'modify_num_posts_for_clients'); |
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
" fdFDa %$£$£fdsaas\\fd465 65 as ".toLowerCase().trim().replace(/ /g,'-').replace(/[^\w-]+/g,'') |
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
'use strict'; | |
var React = require('react'); | |
var Star = React.createClass({ | |
getDefaultProps: function () { | |
return { | |
isActive: false, | |
nStar: 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FormValidation</title> | |
</head> | |
<body> | |
<form id="form" action="http://giphy.com/gifs/xnp2bUzXDhYnS"> | |
<div> | |
<label for="name">First name</label> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Currencies</title> | |
</head> | |
<body> | |
<div> | |
<label for="incoming-price">The price of the leather bag is</label> |
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
window.getGitTag = function(){ | |
return ( | |
$('#content > h2').text().replace('#', '') + | |
'-' + | |
$('#content .subject h3').text().replace('-', '') | |
).replace(' ', '-').toLowerCase(); | |
}; |
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
/** | |
* Returns the name of the branch regarding the task number and title | |
* @example XXX-129-remove-blank-space-from-selector-view | |
*/ | |
function rsGetTitle() { | |
return $('#key-val').text() + '-' + $('#summary-val').text().toLowerCase().replace(/ /g, '-'); | |
} |