Skip to content

Instantly share code, notes, and snippets.

@kirkonrails
kirkonrails / Standard-Gulp-Build.js
Last active Apr 12, 2018
My Gulp Build Script
View Standard-Gulp-Build.js
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
isRetina javascript function to swap images to @2x
View isRetina.js
// 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 Dec 16, 2014
Simple javascript function return the current bootstrap breakpoint
View getCurrentBreakpoint.js
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 Apr 21, 2021
Bootstrap Breakpoints SASS mixin
View Bootstrap-Breakpoints-SASS-Mixin.scss
@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; }
}
View pricing_and_plans.html.erb
<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 Aug 29, 2015
PropertyPublisher - Landing Page
View landing.html.erb
<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 Aug 29, 2015
PropertyPublisher - Application Layout
View application.html.erb
<!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 Apr 9, 2014
Log all jQuery events to console via redfine jquery trigger
View log all jQuery events
var oldJQueryEventTrigger = jQuery.event.trigger;
jQuery.event.trigger = function( event, data, elem, onlyHandlers ) {
console.log( event, data, elem, onlyHandlers );
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
}
View flat-UI-Colors-SASS-Variables
// 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;