Skip to content

Instantly share code, notes, and snippets.

View jentanbernardus's full-sized avatar
:shipit:
Coding everyday keeps the doctor away!

Jentan Bernardus jentanbernardus

:shipit:
Coding everyday keeps the doctor away!
View GitHub Profile
<?php
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
@jentanbernardus
jentanbernardus / tweet_button.html
Created July 15, 2013 05:22
Asynchronous Tweet Button
<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical">Tweet</a>
<!-- Put this JS at the bottom of the page -->
<script id="deferedjs" type="text/javascript">
var b = document.createElement('script');
b.type = 'text/javascript';
b.src = ('http://platform.twitter.com/widgets.js');
var a=document.getElementById("deferedjs");
a.parentNode.insertBefore(b,a);
</script>
<?php
/*
Plugin Name: Plugin Boilerplate
Version: 0.1-alpha
Description: This is how I like to make sense of the WordPress plugin architecture
Author: Adam Davis
Author URI: http://admataz.com
Plugin URI: http://admataz.com
Text Domain: admataz-plugin-boilerplate
Domain Path: /languages
@jentanbernardus
jentanbernardus / webkit-scrollbar.css
Created February 23, 2013 15:28
Custom scrollbars with CSS3 and WebKit
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: none;
}
::-webkit-scrollbar-thumb {
background: -webkit-linear-gradient(left, #547c90, #002640);
@jentanbernardus
jentanbernardus / jquery.scoll.to.top.js
Created February 8, 2013 03:48
Simple jQuery Scroll To Top
$(document).ready(function(){
$("#go-to-top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#go-to-top').fadeIn();
} else {
$('#go-to-top').fadeOut();
}
});
@jentanbernardus
jentanbernardus / index.html
Created February 6, 2013 17:27
A CodePen by Jentan Bernardus. jQuery Countdown
<!-- Countdown dashboard start -->
<div id="countdown_dashboard">
<!--<h1>jQuery Countdown</h1>-->
<hr class="light">
<div class="dash weeks_dash">
<span class="dash_title">weeks</span>
<div class="digit">4</div>
<div class="digit">6</div>
</div>
@jentanbernardus
jentanbernardus / Disable_the_dashboard_welcome_screen.php
Created January 7, 2013 00:43
Hide or Replace the WordPress Welcome Panel [ functions.php ]
//Disable the dashboard welcome screen
//This will only hide the panel, not replace it with any other content.
add_filter("get_user_metadata", "my_own_welcome_panel", 1, 4);
function my_own_welcome_panel($null, $object_id, $meta_key, $single) {
if($meta_key === 'my_own_welcome_panel') { return 0; }
}
@jentanbernardus
jentanbernardus / snippet_1.php
Created January 7, 2013 00:31
Here is my workaround which you can use to show your Gravity Form outside of wordpress using an iframe: 1) Create a page template and paste in the code from Snippet 1. Do not add any header or footer, you only want to display the form itself. 2) Create a wordpress page with the name/slug = gform2 - If you want a different slug than the template …
<!-- Snippet 1 - This is for the page template page-gform2.php -->
<style type="text/css">
#gform_wrapper_2{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif}
</style>
<?php gravity_form(2,false,false) ?>
@jentanbernardus
jentanbernardus / responsive_jquery_cycle.html
Created December 4, 2012 04:51
@malsup's jQuery Cycle in a Responsive Layout
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Responsive Cycle</title>
<style>
@jentanbernardus
jentanbernardus / index.html
Created October 24, 2012 14:42
A CodePen by Brian Gonzalez. Animicons: Sprite animations using icon fonts - Built with [Glyphs](http://glyphsapp.com), processed with [FontPrep](http://fontprep.com), with a little help from [Font Awesome](http://fortawesome.github.com/Font-Awesome/). Ge
<h1>Animicons</h1>
<h4><span class='quiet'>&diams;</span> Sprite Animations Using Icon Fonts <span class='quiet'>&diams;</span></h3>
<div id='icon-container'>
<!-- Broadcast -->
<span data-start='e000'
data-frames='3'
data-interval='200'>
</span>