candland.net Posts

Starting cloudsh search project
Dusty Candland | | cloudsh, golang, javascript, aws lambda

I'm starting a new side project to learn Golang and use AWS Lambda. The basic idea is an API that will index a website and provide a searching interface using JavaScript. The target users are those creating static / generated sites. Sites...

jQuery welcome mat
Dusty Candland | | javascript

Welcome mat for getting email addresses or promoting other things to recent visitors to your site. Hides the form after the first view for 14 days. Needs jQuery before the following code. jQuery(document).ready(function($) { var setCookie =...

Who's Got Your Back
Dusty Candland | | books

Explores the idea of creating a few deep relationships to help you get farther in your goals then you could by yourself. Basically, creating relationships where you can get and give honest feedback to overcome obstacles and roadblocks, some...

The Undoing Project
Dusty Candland | | books

This was an interesting read about where some of hte current thinking about decision-making came from. It's more a story about the two people who worked together to create the these papers, Daniel Kahneman & Amos Tversky. While the...

Steal Like an Artist
Dusty Candland | | books

10 Things Nobody Told You About Being Creative Steal Link an Artist: 10 Things Nobody Told You About Being Creative is a short quick read with lots of ideas about being creative and getting inspiration. Author: Austin Kleon

Create or Hate
Dusty Candland | | books

Make Things! Create or Hate is a quick, short read but very inspiring. Get out there and create things! Author: Dan Norris Other books 7 day startup - Dan Norris Steal Link an Artist - Austin Kleon

Rake Package to Create Zipfile
Dusty Candland | | ruby, rake, wordpress

Small Rakefile to package a WordPress plugin into a zip file that can be installed by uploading. The Rake::PackageTask requires FileTasks that describe how to build the files, since we don't really need to do anything, we just need to...

Clojure Duct setup with MongoDB, Foundation, and Buddy
Dusty Candland | | clojure, duct, compojure, ring, monger, mongodb

Setup a new duct site Why Duct? Well it's a great starting point using most of what I want. Compojure, Ring, Component, ClojureScript, 12 Factor methodology. lein new duct nspkt.ui +cljs +example +heroku +site cd nspkt.ui && lein...

Migrate Google Sites to Jekyll
Dusty Candland | |

Export Install https://github.com/famzah/google-sites-backup google-sites-backup/run.sh gdata-python-client/ google-sites-backup/ Convert to Markdown Install reverse_markdown cd into the exported proj find . -iname "*.html" -exec...

Spark RDD to CSV with headers
Dusty Candland | | clojure, spark

We have some Spark jobs that we want the results stored as a CSV with headers so they can be directly used. Saving the data as CSV is pretty straight forward, just map the values into CSV lines. The trouble starts when you want that data in...

Why ROXIMITY Selected MongoDB – Compose.io
Dusty Candland | |

When we initially started development of ROXIMITY, I decided to go with MongoDB. There were three reasons for this choice: Geospatial support, redundancy and scalability and a lack of schema. If you are thinking about MongoDB, these are...

Capistrano 2 rolling task
Dusty Candland | | capistrano

This took a long time to track down, but this will allow rolling deploys or tasks with Capistrano 2.x. task :rolling, roles: :web do find_servers_for_task(current_task).each do |s| puts roles[:web].clear() server s.host, :web puts...

AngularJS dynamic filter
Dusty Candland | | AngularJS, javascript

Use this to dynamically pass a filter from a controller or somewhere else as a string. It will use DI to lookup the filter and apply it. In the template row.label | date | dynamic:nameFilter In the controller $scope.nameFilter =...

Short MongoDB Fields with Mongoid
Dusty Candland | | mongodb, mongoid

Need to have shorter field name in MongoDB, but still use readable names in code? # Mongoid Timestamps include Mongoid::Timestamps::Short # fields field :aid, as: :application_id, type:String # one to one embeds_one :address, :store_as...

On Writing – Steven King
Dusty Candland | | Books

Part biography and part writing advice. Both were interesting. The advise that jumped out is, Do The Work. For writing that's writing and reading. Which translates well for most things into doing and learning/observing. On Writing

Rails Routes used in an Isolated Engine
Dusty Candland | | engines, rails, routes

The Problem I have a rails application an want to add a blog engine to it. In this case the blogit engine. Things are working well until the layout is rendered. It uses the parent applications layout, which is what I want, but because it’s...

Rails Blog Engines
Dusty Candland | | engines, rails

A list of mountable blog engines for Rails. Blogit Blogit Engine Blogit is a flexible blogging solution for Rails apps. It: Is Rack based; Is a complete MVC solution based on Rails engines; Aims to work right out of the box but remain fully...

Basic Rails Sitemap Setup
Dusty Candland | | rails, ruby, sitemap

A basic sitemap generator for building a sitemap on the fly. I'd like a better way, but since it's hosted on heroku and the map isn't too big yet, this should work for now. Add a route to handle building the XML #...

Open Up Localhost
Dusty Candland | | apache, linux, ssh

In many cases it might be easier/better to just use LocalTunnel. In this case, I didn’t want the external URL changing all the time, and I already have a Linode server setup that I can use. Here are some notes on setting it up. Assumes a...

Node.JS Modules
Dusty Candland | | javascript, nodejs

ExpressJS Web framework. Express-Resource Resource routing. Mongoose ODM for MongoDB. Mongoose-auth User authentication with MongoDB backend, uses everyauth. Passport User authentication. connect-assets Rails 3.1 like asset pipeline...

MongoDB 2012 Notes
Dusty Candland | | mongo, mongodb, nosql

File and Data Structures Key names are stored in the BSON doc, so make sure key names are short. Data files are pre allocated, doubling in size each time. Files are accessed using memory mapped files at the OS level. fsync’d every 60...

Include a Module Based on Rails Environment
Dusty Candland | | rails, ruby

Not sure if this is the best way to do things. But I want to include modules into a class based on the rails environment. First I used the rails config store, Configurator. module MyApp class Application < Rails::Application # ......