A Pen by Captain KK on CodePen.
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^old-domain.net$ [OR] | |
RewriteCond %{HTTP_HOST} ^www.old-domain.net$ | |
RewriteRule (.*)$ https://www.new-domain.com$1 [R=301,L] | |
</IfModule> |
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
add_filter('woocommerce_paypal_args', 'convert_hrk_to_eur'); | |
function convert_hrk_to_eur($paypal_args) | |
{ | |
if ( $paypal_args['currency_code'] == 'HRK') | |
{ | |
$convert_rate = 7.5; //set the converting rate or pull form the DB transients | |
$paypal_args['currency_code'] = 'EUR'; //change HRK to EUR | |
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
add_filter( 'woocommerce_paypal_supported_currencies', 'add_hrk_paypal_valid_currency' ); | |
function add_hrk_paypal_valid_currency( $currencies ) | |
{ | |
array_push ( $currencies , 'HRK' ); | |
return $currencies; | |
} |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Redirect</title> | |
<script type="text/javascript"> window.location = "http://www.youwillberedirectedtothisdomain.com" </script> | |
</head> | |
<body> |
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
add_action( 'admin_menu', 'my_tester_menu' ); | |
function my_tester_menu() | |
{ | |
add_menu_page( 'Tester Options', 'Tester', 'edit_others_pages', 'tester', 'my_tester_options', null, '4.5' ); | |
add_submenu_page( 'tester', 'Tester sub 1', 'Tester sub 1', 'edit_others_pages', 'testers', 'testCodeFunction1'); | |
add_submenu_page( 'tester', 'Tester sub 2', 'Tester sub 2', 'edit_others_pages', 'testers', 'testCodeFunction2'); | |
} |
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
DECLARE @Rn int; | |
DECLARE @RnStart int; | |
DECLARE @RnEnd int; | |
DECLARE @Increment int = 5; | |
DECLARE @PlayerId int = 10; | |
Select @Rn = tt.RowNo FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY PlayerScore desc) as RowNo from Players) tt WHERE tt.PlayerId = @PlayerId; |
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
// full path to your file | |
string yourFilePath = HttpContext.Current.Request.PhysicalApplicationPath + "imageFolder\\yourFile.jpg"; | |
// save downloaded file as (name) | |
string saveFileAs = "yourFile.jpg"; | |
Response.Clear(); | |
Response.AddHeader("content-disposition", "attachment; filename=" + saveFileAs); | |
Response.WriteFile(yourFilePath); | |
Response.ContentType = ""; |