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
@krogsgard
krogsgard / enqueue-scripts.php
Created May 15, 2012 02:23
Sample enqueue scripts action and function
<?php
/*
* WordPress Sample function and action
* for loading scripts in themes
*/
// Let's hook in our function with the javascript files with the wp_enqueue_scripts hook
add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' );
@badsyntax
badsyntax / example.html
Created June 5, 2012 14:43
Twitter bootstrap tabs & jQuery BBQ hashchange history example
<!-- Tab sets have to have an id set -->
<div class="tabs" id="mytab1">
<ul class="nav nav-tabs">
<li><a href="#tab1">Tab 1</a></li>
<li><a href="#tab2">Tab 2</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="tab1">
Content for tab 1
</div>
@miklb
miklb / gist:2919525
Created June 12, 2012 19:13
Filter WordPress Image & Caption to use HTML5 figure
/**
*
* @author pixeline
* @link https://github.com/eddiemachado/bones/issues/90
*
*/
/* Remove Width/Height attributes from images, for easier image responsivity. */
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
@jentanbernardus
jentanbernardus / html
Created June 17, 2012 06:30
Simple jQuery Toggle Javascript snippet
<a href="#" id="toggleButton">Click Here</a>
<div id="toggleSection">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript" src="js/toggle.js"></script>
@jentanbernardus
jentanbernardus / browser-update.js
Created June 25, 2012 20:39
Browser-update.org notification script
//browser-update.org notification script, <browser-update.org>
//Copyright (c) 2007-2009, MIT Style License <browser-update.org/LICENSE.txt>
var $buo = function(op,test) {
var jsv=5;
var n = window.navigator,b;
this.op=op||{};
//options
this.op.l = op.l||n["language"]||n["userLanguage"]||document.documentElement.getAttribute("lang")||"en";
this.op.vsakt = {i:9,f:13,o:12,s:5.1,n:20};
this.op.vsdefault = {i:7,f:3.6,o:10.6,s:4,n:10};
@jentanbernardus
jentanbernardus / The Internet Explorer 6 Countdown
Created June 25, 2012 22:06
Join in moving Internet Explorer 6 users to a modern browser. Follow these steps to help your site visitors be free of Internet Explorer 6. Source: http://www.ie6countdown.com/join-us.aspx
<!--[if lt IE 7]> <div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;'> <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a></div> <![endif]-->
@lancejpollard
lancejpollard / install.bash
Created June 27, 2012 18:21
Upgrade Node.js with Homebrew
$ brew upgrade node
==> Upgrading node
==> Downloading http://nodejs.org/dist/v0.8.0/node-v0.8.0.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/node/0.8.0 --without-npm
==> make install
==> Caveats
Homebrew has NOT installed npm. We recommend the following method of
installation:
curl http://npmjs.org/install.sh | sh
@makeusabrew
makeusabrew / modal.html
Created July 2, 2012 07:07
Twitter Bootstrap - basic dialog box invocation via JavaScript (2)
<!-- set up the modal to start hidden and fade in and out -->
<div id="myModal" class="modal hide fade">
<!-- dialog contents -->
<div class="modal-body">Hello world!</div>
<!-- dialog buttons -->
<div class="modal-footer"><a href="#" class="btn primary">OK</a></div>
</div>
<!-- sometime later, probably inside your on load event callback -->
<script>
@jentanbernardus
jentanbernardus / functions.php
Last active September 28, 2017 15:37
WordPress functions.php Template with 15 Essential Custom Functions (source:http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/)
<?php // custom functions.php template @ digwp.com
// add feed links to header
if (function_exists('automatic_feed_links')) {
automatic_feed_links();
} else {
return;
}
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}