Skip to content

Instantly share code, notes, and snippets.

@cb99999
cb99999 / bs-navbar
Last active December 16, 2015 12:39
bootstrap > template > navbar
<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@cb99999
cb99999 / jq-tocify
Last active December 16, 2015 13:58
jquery: tocify-script
<script>
$(function() {
$("#toc").tocify({ selectors: "h2,h3,h4,h5" }).data("toc-tocify");
$("a[href='#']").click(function(event) {
event.preventDefault();
});
});
</script>
@cb99999
cb99999 / php-pageContentSwitcher
Last active December 16, 2015 13:58
php: insert page content
$page = $_REQUEST['p'];
if (!$page): $page = 'home'; endif;
include('pages/'.$page.'.php');
@cb99999
cb99999 / bs-layout-sidebar-3-9
Last active December 16, 2015 13:58
bootstrap > template > layout > sidebar - content & tocify
<div class="row-fluid">
<div id="sidebar" class="span3">
<div id="toc">
</div><!-- /end #toc -->
</div><!-- /end span3 -->
<div id="content" class="span9">
</div><!-- /end span9 -->
@cb99999
cb99999 / bs-jumbotron
Last active December 16, 2015 21:49
bootstrap > template > pageheader / jumbotron
<!-- Subhead
================================================== -->
<header class="jumbotron subhead">
<div class="container">
<h1>JavaScript</h1>
<p class="lead">Bring Bootstrap's components to life&mdash;now with 13 custom jQuery plugins.
</div>
</header>
@cb99999
cb99999 / php-copy-directories
Created May 2, 2013 19:37
php > copy target set of files to multiple directories
<?php
/*************************
/* copy master files to the farm
/*************************/
function full_copy( $source, $target )
{
if ( is_dir( $source ) ) {
@mkdir( $target ); $d = dir( $source );
while ( FALSE !== ( $entry = $d->read() ) ) {
if ( $entry == '.' || $entry == '..' ) { continue; }
@cb99999
cb99999 / php-current-URL
Created May 2, 2013 19:39
php > function: get current url
/*************************
/* function: get current url
/*************************/
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
@cb99999
cb99999 / jquery-dynamic-resizer
Created May 3, 2013 14:54
jquery > dynamic resizer script
<script>
$(document).ready(function(){
resizeDiv();
});
window.onresize = function(event) {
resizeDiv();
}
/**
@cb99999
cb99999 / css-dynamic-font-size
Created May 3, 2013 14:59
css > dynamic font size
<style>
h1 {
font-size: 3.0vw;
}
p.lead {
font-size: 2.5vh;
}
p {
font-size: 2vmin;
}
@cb99999
cb99999 / bs-tabs
Created May 3, 2013 15:11
bootstrap > template > tabs
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#1" data-toggle="tab">Section 1</a></li>
<li class=""><a href="#2" data-toggle="tab">Section 2</a></li>
<li class=""><a href="#3" data-toggle="tab">Section 3</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="1">
<p>You are watching section 1.</p>
</div><!-- /end tab1 -->