Skip to content

Instantly share code, notes, and snippets.

@mikedijkstra
mikedijkstra / xcode_select.md
Created August 31, 2013 05:52
Set which version of xcode should be loaded

sudo xcode-select --switch /Applications/Xcode.app/

@mikedijkstra
mikedijkstra / ruby motion target simulator.md
Created October 9, 2013 00:33
RubyMotion: Target a specific simulator or iOS version on the fly

RubyMotion makes building and running your app in the simulator as easy as typing rake on the command line.

Sometimes to properly test your app you will need to target a specific simulator or iOS version. Luckily RubyMotion makes this easy to do on the fly.

To target a specific Simulator, run: rake retina=4

To target a specific iOS version, run: rake target=6.0

@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
@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 / 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 / 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://";

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 / 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.
@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 / 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;