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
/** | |
* Takes six lines to correctly add an error to Laravel session errors array. | |
* On the brign side, these errors are directly accessible from views by the name of $errors. | |
* Ref: https://gist.github.com/1int/a1c7162dfeb6014ee26eeda0af5b862f | |
* | |
* @var string $key | |
* @var string $message | |
*/ | |
function flashError($key, $message) { | |
$session = session(); |
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
/* Just set these 2 variables to change wordpress domain in the db */ | |
SET @old_site_domain = 'catsvsdogs.com'; | |
SET @new_site_domain = 'catsvsdogs.dv'; | |
UPDATE wp_options SET option_value = replace(option_value, @old_site_domain, @new_site_domain) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, @old_site_domain, @new_site_domain); | |
UPDATE wp_posts SET post_content = replace(post_content, @old_site_domain, @new_site_domain); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @old_site_domain, @new_site_domain); |
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
#!/bin/sh | |
# | |
# Assuming you have stockfish binary in your PATH, this is the way to invoke it | |
# | |
( | |
echo "position fen r1bq1r2/pp3pk1/5Npp/5n2/3Q4/3B2PP/PP4PK/2R2R2 w - -" ; | |
echo "go depth 15" ; | |
sleep 1 | |
) | stockfish |