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

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
<?php
/**
* Custom browser check
*
* Uses https://github.com/cbschuld/Browser.php
*/
function b5f_browser_check($what) {
global $browser, $browver;
switch ($what) {
@chrisblakley
chrisblakley / step2.php
Created October 16, 2014 02:29
Querying current weather conditions to make it rain or snow on your site.
<div id="bgimgweather">
<?php
$url = 'http://w1.weather.gov/xml/current_obs/KSYR.xml';
$xml = simplexml_load_file($url);
$currentweather = $xml->weather;
//$currentweather = "Light Rain";
?>
</div>
@kanakiyajay
kanakiyajay / Gruntfile.js
Created June 13, 2015 11:17
This Gruntfile.js will clean your dist folder, concat & minify all js, css assets according config specified in html, put revisions, minify html and copy new folder structure to dist.
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: ['dist'],
copy: {
generated: {
src: 'src/index.html',
dest: 'dist/index.html'
@mfields
mfields / mfields.org-post-loader.php
Created December 6, 2010 16:16
jQuery Post Loader for WordPress Home Page
<?php
/*
Plugin Name: mfields.org - Ajax Append Posts
Plugin URI:
Description:
Version: 0.1.2
Author: Michael Fields
Author URI: http://mfields.org/
Copyright 2010 Michael Fields michael@mfields.org
License GPLv2
// Campaign Monitor jQuery plugin
// Chris @ Anywhichway 2010
//
// usage $(form).campaignMonitor(), where form is the signup form that Campaign Monitor generates
jQuery.fn.campaignMonitorSignup = function(options) {
var defaults = {
callbacks: {
success: function(){},
@metinsaylan
metinsaylan / bootstrap-navbar.php
Created January 20, 2015 21:57
Bootstrap Navbar for WordPress
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Navbar Header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapsible">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@bhubbard
bhubbard / pager.php
Last active September 27, 2015 15:03 — forked from metinsaylan/pager.php
Bootstrap pager links for WordPress single.php template
<?php
// This template can be included in your single.php template to display <Previous-Next> links below your post.
// It uses aligned pager template stated here > http://getbootstrap.com/components/#aligned-links
?>
<nav>
<ul class="pager">
<?php
$post_permalink = get_permalink();
$previous_post = get_permalink(get_adjacent_post(false,'',false));
define("GF_THEME_IMPORT_FILE", "http://www.domain.com/path/to/gf_import.xml");
define("GF_LICENSE_KEY", "YOUR-LICENSE-KEY-HERE");
// Gravity Forms - Recaptcha Keys
define("GF_RECAPTCHA_PUBLIC_KEY", "YOUR-KEY-HERE");
define("GF_RECAPTCHA_PRIVATE_KEY", "YOUR-KEY-HERE");
// Default Import Forms
@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>