Skip to content

Instantly share code, notes, and snippets.

<?php
$country_code = $_SERVER ["HTTP_CF_IPCOUNTRY"];
if ($country_code=="US") {
$link = 'http://us.domain.com';
}
else if ($country_code=="GB") {
$link = 'http://uk.domain.com';
}
import datetime
import io
import os
import pyperclip
import re
import shutil
import sys
from google.cloud import storage
from PIL import Image
@bwhli
bwhli / wp
Created August 18, 2018 02:55
<?php get_header(); ?>
<div class="posts">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<h1 class="post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h1>
@bwhli
bwhli / Redirect WordPress Logout to Home Page
Created July 7, 2015 04:54
Redirect WordPress Logout to Home Page
//* Redirect WordPress Logout to Home Page
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
<?php
/**
* Product attributes
*
* Used by list_attributes() in the products class
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.3
*/
<link rel="canonical" href="https://brianli.com/how-to-republish-to-medium-with-rel-canonical/" />
User Name,Access Key Id,Secret Access Key
"jarjarbinks",AKIAIYFWEWC6W5BWJFKG,RQjn8AGQ26jpWtBqH+JcOk4ZSopQYQbLlC2fjWr+
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
<?php
/* This is a sample config file.
* Edit this file with your own settings and save it as "config.php"
*
* IMPORTANT: edit and save this file as plain ASCII text, using a text editor, for instance TextEdit on Mac OS or
* Notepad on Windows. Make sure there is no character before the opening <?php at the beginning of this file.
*/
/*
** MySQL settings - You can get this info from your web host
<?php
header('Location:http://yoururl.com/');
?>