Skip to content

Instantly share code, notes, and snippets.

@mikedijkstra
mikedijkstra / loader.scss
Created January 16, 2017 19:05
Loader Module
@mixin loader {
body.preload {
* {
transition: none !important;
animation-name: none !important;
}
.loader {
visibility: visible;
}
@mikedijkstra
mikedijkstra / loader.html
Created January 16, 2017 19:04
Loader Module
<body class="preload">
<div class="loader"></div>
</body>
<script>
$(window).load(function() {
$("body").removeClass("preload");
});
</script>
@mikedijkstra
mikedijkstra / nav.scss
Created January 16, 2017 19:03
Nav Module
@mixin nav {
.nav {
height: $nav-height;
position: relative;
z-index: 10;
li > a {
color: $color-brand;
height: $nav-height;
line-height: $nav-height;
@mikedijkstra
mikedijkstra / nav.html
Created January 16, 2017 19:02
Nav Module
<div class="nav-overlay collapse" id="nav-overlay" data-toggle="collapse" data-target="#nav-menu, #nav-overlay"></div>
<div class="container-fluid">
<div class="nav row" id="nav">
<div class="nav-brand col-xs-9 col-sm-5">
<a href="/" itemprop="url" class="nav-logo">
<img src="http://placehold.it/500x250&text=Logo" alt="CompanyName" itemprop="logo">
</a>
</div>
<div class="pull-right visible-xs">
@mikedijkstra
mikedijkstra / vertical_align.js
Created January 16, 2017 18:58
Vertical Align JS
window.Stencil = window.Stencil || {};
/*doc
---
title: Vertical Align
name: vertical-align
category: Utilities
---
Aligns elements vertically.

Keybase proof

I hereby claim:

  • I am micdijkstra on github.
  • I am micdijkstra (https://keybase.io/micdijkstra) on keybase.
  • I have a public key ASD5UXVmY1Qc77Aluyc-7ca0yYjR2CNLNbAbNQWuVHJYZgo

To claim this, I am signing this object:

@mikedijkstra
mikedijkstra / app redirect.js
Created May 17, 2016 13:49
Open app or redirect to app store.
setTimeout(function () { window.location = "https://play.google.com/store/ap...";}, 25);
window.location = "appname://";
@mikedijkstra
mikedijkstra / group_by_day.rb
Last active August 29, 2015 14:16
Rails: Group by day showing empty days
notifications = Notifications.where('notifications.created_at BETWEEN ? AND ?', start_date, end_date)
notifications_by_date = notifications.group_by { |notification| notification.created_at.to_date }
@notifications_by_day = (start_date.to_date..end_date.to_date).map do |date|
{
day: date,
notifications: notifications_by_date[date] || [],
}
end
@notifications_by_day.reverse!
@mikedijkstra
mikedijkstra / totalizer_design.md
Last active August 29, 2015 14:06
Totalizer Design Tasks

Dashboard

Dashboard

Key elements

  • Header navigation
  • Metric modules (see below)

@mikedijkstra
mikedijkstra / localhost_on_vm.md
Last active December 27, 2015 05:58
How to access your local host on VM
  1. Find out your computer name by running hostname in terminal
  2. Access your localhost through [computername].local:3000

If that doesn't work, try:

  1. Find the IP for the current LAN connection on your VM
  2. Use the IP address, changing the last number to one. eg) http://172.16.215.1:3000