Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Pseric Pseric

💭
I may be slow to respond.
View GitHub Profile
View fix-gravatar-alt.js
function crunchify_gravatar_alt( $crunchifyGravatar ) {
if ( have_comments() ) {
$alt = get_comment_author();
}
else {
$alt = get_the_author_meta( 'display_name' );
}
$crunchifyGravatar = str_replace( 'alt=\'\'', 'alt=\'Avatar for ' . $alt . '\' title=\'Gravatar for ' . $alt . '\'', $crunchifyGravatar );
return $crunchifyGravatar;
}
View gist:7b40e2d0fd9ee7a2698220c8d7c31695
<script>
function loadAPI() {
var js = document.createElement('script');
js.src = '//connect.facebook.net/zh_TW/sdk.js#xfbml=1&appId=YOUR_APP_ID&version=v3.2';
document.body.appendChild(js);
}
window.onscroll = function () {
var rect = document.getElementById('comments').getBoundingClientRect();
if (rect.top < window.innerHeight) {
View gist:41e687628f2f91736ae7180229633298
<meta property="fb:admins" content="YOUR_FACEBOOK_USER_ID" />
<meta property="fb:app_id" content="YOUR_APP_ID" />
View css filter grayscale.htm
<style>
html {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
_filter: none;
}
</style>
View css filter grayscale.css
html {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
_filter: none;
}
View gist:ab240898fdbaf846797c905c57a5cb95
<script type='text/javascript' src='https://c0.wp.com/c/4.9.8/wp-includes/js/jquery/jquery.js'></script>
<script type='text/javascript' src='https://c0.wp.com/c/4.9.8/wp-includes/js/jquery/jquery-migrate.min.js'></script>
<link rel='stylesheet' id='jetpack_css-css' href='https://c0.wp.com/p/jetpack/6.6.1/css/jetpack.css' type='text/css' media='all' />
<link rel='stylesheet' id='dashicons-css' href='https://c0.wp.com/c/4.9.8/wp-includes/css/dashicons.min.css' type='text/css' media='all' />
<link rel='stylesheet' id='admin-bar-css' href='https://c0.wp.com/c/4.9.8/wp-includes/css/admin-bar.min.css' type='text/css' media='all' />
<link rel='stylesheet' id='genericons-css' href='https://c0.wp.com/p/jetpack/6.6.1/_inc/genericons/genericons/genericons.css' type='text/css' media='all' />
<link rel='stylesheet' id='twentysixteen-jetpack-css' href='https://c0.wp.com/p/jetpack/6.6.1/modules/theme-tools/compat/twentysixteen.css' type='text/css' media='all' />
@Pseric
Pseric / facebook-customer-chat-plugin.htm
Created Nov 30, 2017
Facebook Customer Chat Plugin
View facebook-customer-chat-plugin.htm
<div class="fb-customerchat"
page_id="<PAGE_ID>"
ref="<OPTIONAL_WEBHOOK_PARAM>"
minimized="<true|false>">
</div>
@Pseric
Pseric / Facebook-SDK.htm
Created Nov 30, 2017
Facebook JavaScript SDK
View Facebook-SDK.htm
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'your-app-id',
autoLogAppEvents : true,
xfbml : true,
version : 'v2.11'
});
};
@Pseric
Pseric / index.js
Created Nov 10, 2016 — forked from M157q/index.js
佛祖保佑 永無 BUG (May Budda bless you no bug forever)
View index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
View youtube-audio-player.html
<div data-video="VIDEO_ID"
data-autoplay="0"
data-loop="1"
id="youtube-audio">
</div>
<script src="https://www.youtube.com/iframe_api"></script>
<script src="https://cdn.rawgit.com/labnol/files/master/yt.js"></script>