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
" 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
<?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
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 | |
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
//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
/** | |
* Test with / on the url | |
* | |
* @Route("/test/{test}", requirements={"test" = "(.*)"}) | |
* @Method("GET") | |
* @Template() | |
*/ | |
public function testAction($test) { | |
if($otherLinks) | |
{ |
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
#create rutes | |
tree -fi | sed -r 's/\.\/|.md//g' | tail -n +2 | \ | |
while read CMD; do | |
echo '['$CMD']('$CMD')' | |
echo '' | |
done > list-files.md | |
#check the file length | |
numberLines=$(cat list-files.md | wc -l) |
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
#solve symfony linux permission problems | |
sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs | |
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs |
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
/* | |
The aim of this test is to check the performance (as speed) and the memory creating instances of objects with public or private methods. | |
We want to see if create a private method in js really hurts the performance. | |
For that we will compare the performance creating so many instances and checking the performance | |
*/ | |
function Public(){ | |
this.publicMethod = function(){ |