Skip to content

Instantly share code, notes, and snippets.

View kirkonrails's full-sized avatar

Kirk Quesnelle kirkonrails

View GitHub Profile
@kirkonrails
kirkonrails / Standard-Gulp-Build.js
Last active April 12, 2018 15:18
My Gulp Build Script
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
gutil = require('gulp-util'),
concat = require('gulp-concat'),
babel = require('gulp-babel'),
gzip = require('gulp-gzip'),
minifyCss = require('gulp-minify-css'),
@kirkonrails
kirkonrails / isRetina.js
Last active May 15, 2018 00:16
isRetina javascript function to swap images to @2x
// To make images retina, add a class "2x" to the img element
// and add a <image-name>@2x.png image. Assumes jquery is loaded.
function isRetina() {
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
if (window.devicePixelRatio > 1)
@kirkonrails
kirkonrails / getCurrentBreakpoint.js
Created December 16, 2014 18:53
Simple javascript function return the current bootstrap breakpoint
window.getCurrentBreakpoint = ->
width = $(window).width()
if width < 768
"xs"
else if width < 992
"sm"
else if width > 991 && width < 1200
"md"
else if width >= 1200
"lg"
@kirkonrails
kirkonrails / Bootstrap-Breakpoints-SASS-Mixin.scss
Last active November 14, 2022 16:36
Bootstrap Breakpoints SASS mixin
@mixin breakpoint($minWidth: 0, $maxWidth: 0, $minHeight: 0, $maxHeight: 0) {
$type: type-of($minWidth);
@if $type == string {
$class: $minWidth;
@if $class == xs {
@media (max-width: 767px) { @content; }
}
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Pricing and Plans</h1>
<p>Below you will find our pricing and plans. Once you subscribe to a plan you can cancel at any time for any reason. </p>
</div>
</div>
</div>
<div class="container" style='margin-top: 20px;'>
@kirkonrails
kirkonrails / landing.html.erb
Last active August 29, 2015 14:00
PropertyPublisher - Landing Page
<div class="jumbotron">
<div class="container">
<div class='col-md-8'>
<h1>Rental Property Promotion Software</h1>
<p>PropertyWare makes it unbelievably easy to publish and promote all of your rental properties online.
Receive inqiuries easily, send out alerts, automatically post to facebook, twitter, craiglist, kijiji and more.
<p><a class="btn btn-primary btn-lg" role="button">See Pricing &amp; Plans</a></p>
</div>
<div class='col-md-4'>
@kirkonrails
kirkonrails / application.html.erb
Last active August 29, 2015 14:00
PropertyPublisher - Application Layout
<!DOCTYPE html>
<html>
<head>
<title>PropertyWare</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body style='padding-top: 51px'>
@kirkonrails
kirkonrails / log all jQuery events
Created April 9, 2014 13:20
Log all jQuery events to console via redfine jquery trigger
var oldJQueryEventTrigger = jQuery.event.trigger;
jQuery.event.trigger = function( event, data, elem, onlyHandlers ) {
console.log( event, data, elem, onlyHandlers );
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
}
// Thanks to @ahmetsulek for providing this list. I find it useful
// to have this in my sass file when starting a new project.
// http://flatuicolors.com/
$turquoise: #1abc9c;
$greensea: #16a085;
$emerald: #2ecc71;
$nephritis: #27ae60;
$peterriver: #3498db;
$belizehole: #2980b9;