Skip to content

Instantly share code, notes, and snippets.

@mikedijkstra
mikedijkstra / mongodump_mongorestore
Last active September 26, 2015 02:58
Copying local mongoDB to mongoHQ
mongodump -h [HOST]:[PORT] -u [USERNAME] -d [DB NAME] --password [PASSWORD]
mongorestore -h [HOST]:[PORT] -u [USERNAME] -d [DB NAME] --password [PASSWORD] [SOURCE]
@mikedijkstra
mikedijkstra / gist:1028391
Created June 15, 2011 23:30
Rails: Compass and Heorku
The default installation of compass in a rails app that is deployed to Heroku can cause some issues due to the nature of Heroku's read only file system.
A quick fix to this problem (assuming you develop locally and just deploy to production) you can add the following lines of code to config/compass.rb
environment = Compass::AppIntegration::Rails.env
if environment == :production
Sass::Plugin.options[:never_update] = true
end
@mikedijkstra
mikedijkstra / gist:1028393
Created June 15, 2011 23:31
New rails app using Mongoid
Create a new rails app
$ rails new [app_name]
Update your gem file to include mongoid and bson_ext
gem 'mongoid'
gem 'bson_ext'
@mikedijkstra
mikedijkstra / new_laptop_setup.md
Created September 20, 2011 20:17
New Laptop Setup
  1. Install the following applications: Alfred App Chrome Dropbox Sublime Text 2 Xcode

  2. Add the following to ~/.bash_profile

Add git to the command line

@mikedijkstra
mikedijkstra / git is easy
Created October 6, 2011 10:49
Git Workflow
# Git Workflow
1. Navigate to your sites folder with "cd ~/sites"
2. Clone your repo with "git clone <URL>"
3. Move into the repo with "cd <FOLDERNAME>"
4. Move onto the development branch with "git checkout development"
@mikedijkstra
mikedijkstra / gist:1492191
Created December 18, 2011 02:39
Social Share Links

#SOCIAL SHARING LINKS

##Copy and paste the following into the HEAD of your page:

<style>
	#social_share span {display: inline; float: left; vertical-align: top;}
	#social_share span.title {font-weight: bold; font-size: 1.2em; margin-right: 10px;}
</style>

##Copy and paste the following where you'd like the share buttons to appear:

@mikedijkstra
mikedijkstra / social_share_links_wordpress
Created January 9, 2012 21:51
Social Share Links - Wordpress
@mikedijkstra
mikedijkstra / foundationBoxShadowHelper.css
Created August 1, 2012 18:18
Foundation: Box Shadow Helper
/**
* Box Shadow
*
* @category Foundation
* @package Helper
* @subpackage BoxShadow
*/
.bsis {
-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.25);
-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.25);
@mikedijkstra
mikedijkstra / new_mac.md
Last active October 18, 2022 14:57
How to setup a new mac for Ruby on Rails development with MongoDB, Imagemagick and POW

Makre sure your home directory does not have a space in it or gcc will crap itself

1. Download and install Xcode

2. Install Command Line Tools (Xcode > Preference > Downloads)

4. Install Git

$ brew install git

@mikedijkstra
mikedijkstra / gist:5392032
Last active December 16, 2015 06:29
Download Postgres backup from Heroku

Make a backup: heroku pgbackups:capture or heroku pgbackups:capture --expire

Get the URL: heroku pgbackups:url

Download: curl -o latest.dump "URL"

Import: $ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump