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 isEmail(str){ | |
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; | |
return reg.test(str); | |
} | |
function IsNumeric(input) | |
{ | |
return (input - 0) == input && input.length > 0; | |
} |
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
# force www in url | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] | |
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] | |
# END force www in url | |
Report |
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
/*opacity-hack*/ | |
selector { | |
filter: alpha(opacity=60); /* MSIE/PC */ | |
-moz-opacity: 0.6; /* Mozilla 1.6 and older */ | |
opacity: 0.6; | |
} | |
/* clear float */ | |
.clear { |
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 if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?> | |
<?php wp_pagenavi(); // Use PageNavi ?> | |
<?php } else { // Otherwise, use traditional Navigation ?> | |
<?php if ( get_next_posts_link() ) : ?> | |
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'glasses' ) ); ?></div> | |
<?php endif; ?> |
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 | |
$w = '350'; | |
$h = '200'; | |
if (has_post_thumbnail()) { | |
$large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); | |
echo '<img class="wp-post-image" src="' . get_bloginfo("template_url") . '/timthumb.php?src=' . $large_image_url[0] . '&w=' . $w . '&h=' . $h . '" alt="' . get_the_title() . '" title="#htmlcaption' . get_the_ID() . '" /></a>'; | |
} else { | |
echo '<img src="http://fakeimg.pl/350x200/?text=NoPictrue&font=lobster" alt="no pictrue" />'; | |
} | |
?> |
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 | |
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
add_action('admin_menu', 'my_theme_options_menu'); | |
function my_theme_options_menu() { | |
add_action('admin_print_scripts', 'my_options_admin_scripts'); | |
add_action('admin_print_styles', 'my_options__admin_styles'); |
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 | |
require_once('BFI_Thumb.php'); | |
add_filter( 'the_content', 'itc_the_content_img_filter', 999 ); | |
/** | |
* Reduces size of images in posts using bfi_thumb | |
* | |
*/ | |
function itc_the_content_img_filter( $content ) { | |
/* Add here the width you prefer (max width of your posts) */ |
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
## Logs | |
``` | |
kubectl logs my-pod # dump pod logs (stdout) | |
kubectl logs -l name=myLabel # dump pod logs, with label name=myLabel (stdout) | |
kubectl logs my-pod --previous # dump pod logs (stdout) for a previous instantiation of a container | |
kubectl logs my-pod -c my-container # dump pod container logs (stdout, multi-container case) | |
kubectl logs -l name=myLabel -c my-container # dump pod logs, with label name=myLabel (stdout) | |
kubectl logs my-pod -c my-container --previous # dump pod container logs (stdout, multi-container case) for a previous instantiation of a container |
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
import React, { useState, useContext, createContext } from 'react'; | |
import ReactDOM from 'react-dom'; | |
function log(...str){ | |
console.log(...str) | |
} | |
const rowStyle = { | |
display: 'flex' | |
} |
OlderNewer