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
# SSH Agent | |
# Note: ~/.ssh/environment should not be used, as it | |
# already has a different purpose in SSH. | |
# source : https://www.schoonology.com/technology/ssh-agent-windows/ | |
env=~/.ssh/agent.env | |
# Note: Don't bother checking SSH_AGENT_PID. It's not used | |
# by SSH itself, and it might even be incorrect | |
# (for example, when using agent-forwarding over SSH). |
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
# Matching only Wordpress.com calls. RPC disable due security issue. | |
<FilesMatch "xmlrpc\.php$"> | |
Satisfy Any | |
Allow from all | |
</FilesMatch> | |
Along with a Plugin here: Disable XML-RPC Pingback. |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com'); |
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
//Get host name from URL | |
preg_match('@^(?:https?://)?([^/]+)@i', | |
"http://www.php.net/index.html", $matches); | |
$host = $matches[1]; | |
//Get last two segments of host name | |
preg_match('/[^.]+\.[^.]+$/', $host, $matches); | |
echo "domain name is: {$matches[0]}\n"; | |
//Check for valid 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
using System; | |
namespace TaxCalculator | |
{ | |
class TaxCalculator | |
{ | |
static void Main(string[] args) | |
{ | |
int salary; |
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 | |
$searchTerm = 'mail'; | |
$language = 'php'; | |
$reposPerPage = 100; | |
$repoUrls = array(); | |
$page = 1; | |
// Start paging |
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
git config --global alias.migrations 'log -- **/Migrations/**/*.cs' |
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
#!/usr/bin/env bash | |
changed_files="$(git diff ORIG_HEAD HEAD --name-only | grep "/Migrations/")" [[ ! -z $changed_files ]] && echo -e "\e[91mIncoming Migrations!\e[39m $changed_files" |
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
set numbers |
NewerOlder