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
SomeRoute: | |
pattern: /someroute | |
defaults: | |
_controller: SomeBundle:Controller:action | |
AnotherRoute: | |
pattern: /anotherroute | |
defaults: | |
_controller: FrameworkBundle:Redirect:redirect | |
route: SomeRoute |
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
private function getSearchTypeList() | |
{ | |
foreach ($this->choices as $choice) { | |
yield $choice => 'type.' . $choice; | |
} | |
} | |
//then | |
iterator_to_array($this->getSearchTypeList()) | |
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
The .git/info/exclude file has the same format as any .gitignore file. Another option is to set core.excludesFile to the name of a file containing global patterns. | |
Note, if you already have unstaged changes you must run the following after editing your ignore-patterns: | |
git update-index --assume-unchanged [<file>...] | |
Note on $GIT_DIR: This is a notation used all over the git manual simply to indicate the path to the git repository. If the environment variable is set, then it will override the location of whichever repo you're in, which probably isn't what you want. | |
Link: http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally |
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
'years' => range(date('Y'), 2014) |
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
class InvalidRowException extends \Exception | |
{ | |
public static function incorrectColumns(Row $row) { | |
return new static("Row #" . $row->getIndex() . " is missing one or more columns"); | |
} | |
} | |
if (!$row->hasColumns($expectedColumns)) { | |
throw InvalidRowException::incorrectColumns($row); | |
} |
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
git fetch origin | |
git reset --hard origin/master |
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
git checkout develop | |
git pull | |
git checkout branch #co by zapisać | |
git fetch develop | |
git rebase upstream/develop develop #tutaj sobie cofamy |
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 | |
function removeShit() | |
{ | |
global $wpdb; | |
$posts = $wpdb->get_results(" | |
SELECT wp.ID, wp.post_content FROM wp_posts wp, novationstudio_events_event e WHERE wp.post_title = e.title; | |
"); | |
foreach($posts as $post) { |
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
$node = \Drupal::routeMatch()->getParameter('node'); | |
if ($node) { | |
// You can get nid and anything else you need from the node object. | |
$nid = $node->id(); | |
} |
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
function generate_random($string) { | |
$charactersLength = strlen($string); | |
$randomString = ''; | |
for ($i = 0; $i < $charactersLength; $i++) { | |
$randomString .= $string[rand(0, $charactersLength - 1)]; | |
} | |
return $randomString; | |
} |
OlderNewer