Skip to content

Instantly share code, notes, and snippets.

@killa-kyle
killa-kyle / wavesurfer-wavescrollbar
Created January 26, 2015 03:46
scrollbar for wavesurfer
'use strict';
WaveSurfer.WaveScrollbar = {
defaultParams: {
height: 100,
cursorWidth: 1,
cursorColor: '#ffea00',
windowColor: 'rgba(59,105,22,0.4)',
},
init: function (params) {
@killa-kyle
killa-kyle / prettyTime
Created February 14, 2015 03:58
timecode conversion
// convert milliseconds to hours, minutes, seconds
var prettyTime = function() {
return function(value) {
var hours = Math.floor(value / 3600),
mins = '0' + Math.floor((value % 3600) / 60),
secs = '0' + Math.floor((value % 60));
mins = mins.substr(mins.length - 2);
secs = secs.substr(secs.length - 2);
if(!isNaN(secs)){
if (hours){
function scripts() {
if ( !is_admin() ) { // this if statement will insure the following code only gets added to your wp site and not the admin page cause your code has no business in the admin page right unless that's your intentions
// jquery
wp_deregister_script('jquery'); // this deregisters the current jquery included in wordpress
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"), false); // this registers the replacement jquery
wp_enqueue_script('jquery'); // you can either let wp insert this for you or just delete this and add it directly to your template
// your own script
wp_register_script('yourscript', ( get_bloginfo('template_url') . '/yourscript.js'), false); //first register your custom script
wp_enqueue_script('swfobject'); // then let wp insert it for you or just delete this and add it directly to your template
// just in case your also interested
/* =================================
=== STICKY NAV ====
=================================== */
$(document).ready(function() {
$('.main-navigation').onePageNav({
scrollThreshold: 0.5, // Adjust if Navigation highlights too early or too late
filter: ':not(.external)',
changeHash: true
});
$('a[href^="#"]').click(function(event) {
var id = $(this).attr("href");
var target = $(id).offset().top;
$('html, body').animate({scrollTop:target - 50}, 500);
event.preventDefault();
});
@killa-kyle
killa-kyle / dropcap.css
Created September 24, 2015 17:41
Article Dropcap
.dropcap {
float: left;
font-family: "proxima-nova", sans-serif;
font-size: 119.2px;
line-height: 90px;
font-weight: 400;
color: #2a5781;
padding-right: 10px;
margin-top: 10px;
margin-bottom: -1px;
@killa-kyle
killa-kyle / state_borders.php
Created September 24, 2015 20:24
US states and their border states
$state_border['AK']=array('WA');
$state_border['AL']=array('TN','GA','FL','MS');
$state_border['AR']=array('MO','TN','MS','LA','TX','OK');
$state_border['AZ']=array('UT','CO','NM','CA','NV');
$state_border['CA']=array('OR','NV','AZ','HI');
$state_border['CO']=array('WY','NE','KS','OK','NM','AZ','UT');
$state_border['CT']=array('MA','RI','NY');
$state_border['DC']=array('MD','VA');
$state_border['DE']=array('PA','NJ','MD');
$state_border['FL']=array('GA','AL');
@killa-kyle
killa-kyle / gist:58b5e04eb87739baa8e5
Created October 19, 2015 14:23
Make Two Divs the Same Height
var $columns = $('.column');
var height = 0;
$columns.each(function () {
if ($(this).height() > height) {
height = $(this).height();
}
});
$columns.height(height);
@killa-kyle
killa-kyle / Bootstrap print styles
Created November 2, 2015 22:14 — forked from donnierayjones/LICENSE
Render Bootstrap as "small" layout when printing
@media print {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
var vars = [], hash;
var q = document.URL.split('?')[1];
if(q != undefined){
q = q.split('&');
for(var i = 0; i < q.length; i++){
hash = q[i].split('=');
vars.push(hash[1]);
vars[hash[0]] = hash[1];
}
}