Skip to content

Instantly share code, notes, and snippets.

View andy922200's full-sized avatar

Andy Lien andy922200

View GitHub Profile
/*Original format*/
if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
preg_match_all( '/./u', $text, $words_array );
$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
$sep = '';
} else {
$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
$sep = ' ';
@andy922200
andy922200 / Example-1.css
Last active January 30, 2019 21:56
ALPHA CAMP Semester 1 Week 2
*{
box-sizing:border-box; /* 全版面使用,讓排版較為直覺。*/
}
.clearfix{
clear:both;
}
#banner{
background-image:url("http://picsum.photos/1170/450?image=950");
@andy922200
andy922200 / fb-chat-records-download.js
Last active January 20, 2019 01:59
Facebook Chat Records Download
var id =
setInterval(function () { document.getElementById('see_older')
.getElementsByClassName('content')[0].click(); }, 500);