Skip to content

Instantly share code, notes, and snippets.

update table_name set col_name = replace(col_name,'target_string','expected_string');
@streetcoder
streetcoder / create ddl
Last active January 9, 2017 10:58
create ddl
CREATE TABLE table_name (
id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT "Primary Key",
session_id VARCHAR(255) NOT NULL COMMENT "php session id",
ip_address VARCHAR(100) NOT NULL COMMENT "IP Address of user",
uid INT(10) UNSIGNED DEFAULT 0 NOT NULL COMMENT "User ID where id=0 is anonymous",
nid INT(10) UNSIGNED NOT NULL COMMENT "Articl/node ID",
emo ENUM('a','b','c','d','e') NOT NULL COMMENT "emotions: a=grin, b=smile, c=sad, d=straight-face, e=love",
created DATETIME DEFAULT CURRENT_TIMESTAMP,
updated DATETIME,
PRIMARY KEY (id)
// this code should underneat of loop
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
$pcount = 0;
$wrap_div = '<div class="tri-wrap-post">';
/* Start the Loop */
echo $wrap_div;
while ( have_posts() ) : the_post(); $pcount ++;
get_template_part( 'template-parts/content', get_post_format() );
if ( $pcount % 3 == 0 ) {
@streetcoder
streetcoder / phpstorm shortcut
Last active June 14, 2017 11:00
PhpStorm common shortcuts
Open window for tab shift + f4
Open window of structure panel ctrl + f12
Import Class alt + Enter
Generate Docblock alt + insert
Open window refactor ctrl + shift + alt + T
File rename shift + f6
File current file ctrl + f4