Skip to content

Instantly share code, notes, and snippets.

View jongacnik's full-sized avatar

Jon jongacnik

View GitHub Profile
var gulp = require('gulp')
, concat = require('gulp-concat')
, watch = require('gulp-watch')
, uglify = require('gulp-uglify')
, minifyCSS = require('gulp-minify-css')
, sass = require('gulp-sass')
, livereload = require('gulp-livereload')
, plumber = require('gulp-plumber')
, gutil = require('gulp-util')
, autoprefixer = require('gulp-autoprefixer')
@jongacnik
jongacnik / readme.md
Last active August 29, 2015 14:01
Route Mapping Module

Route Mapping Module

Small regex based router (maybe route checker is a better name) whose main purpose is just to map routes to functions. Built with the intention of using with jQuery pjax, so on pjax:complete check to see if the new route has specific code that needs to be executed. If you don't want to use with pjax, just leave the event option blank (or plop in any event you want the router to be bound to). There's jQuery dependency in here, but could be rejiggered to be without pretty easy.

Check out the router.usage.js file for config.

Regex matching logic from miniroutes!

@jongacnik
jongacnik / expandtext.modified.js
Last active August 29, 2015 14:01
Expand Text Modified
/**
* jQuery ExpandText Modified
* Expands or shrinks text (with relative line-height) until it's height hits the edges of it's parent.
* Modified by @amongiants from original script by Michael Botsko (http://www.botsko.net)
*/
(function($){
$.fn.expandText = function(options){
opts = $.extend({ min: 50, max: 500, increment: 2, lineHeight: 1.2 },options);
return this.each(function(){
var me = $(this), max_y = me.height()-(opts.increment*2), span = me.find('.expandedText'), size = opts.min;
@jongacnik
jongacnik / manila-slider.js
Last active August 29, 2015 14:01
Manila Slider
/*!
* Manila Slider
* Original author: @amongiants
* Version: W.I.P
* Dependencies: jQuery, Velocity
*
* Required CSS
* ============
*
* .manila-slider {
@jongacnik
jongacnik / boiler-module.js
Created May 31, 2014 22:14
Boiler Module Template
/**
* Boiler Module
*/
Modules.Boiler = function(options) {
var _ = {
};
@jongacnik
jongacnik / wp_adjacent_query.php
Last active August 29, 2015 14:02
Custom Wordpress adjacent post query
<?php
function get_adjacent_posts_clean($prev = true, $limit = 1, $exclude = '', $date = '') {
global $wpdb, $post;
if( empty( $date ) )
$date = $post->post_date;
$limit = absint( $limit );
if( !$limit )
return;
@jongacnik
jongacnik / aspect.js
Created June 21, 2014 01:01
Aspect Ratio Helpers
// assumes jQuery or applicable DOM library
function getAspectByEle(ele){
var width = ele.width();
var height = ele.height();
return getAspectByVal(width,height);
}
function getAspectByEleAttr(ele){
var width = ele.attr('width');
@jongacnik
jongacnik / unit.js
Created June 27, 2014 02:50
Unit Boiler
/**
* Unit
*/
Site.Unit = function(Options) {
// Private data
var _ = {
};
@jongacnik
jongacnik / local.wordpress.md
Created June 27, 2014 18:45
Local Wordpress

Terminal

$ cd /Path/To/Dir/With/Wordpress $ sudo chown -R :_www wordpress-dir $ sudo chmod -R g+w wordpress-dir

wp-config.php

define('FS_METHOD', 'direct');

@jongacnik
jongacnik / vjs.boiler.css
Last active August 29, 2015 14:03
Video JS skin boiler plate (SASS)
/**
* Variables
* Description: reusable options
*/
$control-bar-height : 20px;
$control-bar-background : #cccccc;
$handle-width: 3px;
$play-button-width: 50px;
$fullscreen-button-width: 50px;
$ui-color: #ffffff;