Writing
MongoDB 2012 Notes
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 se...
Include a Module Based on Rails Environment
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 ...
Send Commands From VIM to Tmux Pane
I've started using Tmux w/ VIM as my primary work flow. I installed the tslime.vim plugin, which will send highlighted commands to another pane, but I wanted to send ad-hoc commands, like :!. I added this function to the tslime.vim file,...
ITerm2 TMux and Vim Setup
Setup Install MacVim Install ITerm2 Install Tmux: brew install tmux Install Tmux Patch for copy to OSX: tmux-MacOSX-pasteboard Change shell to zsh chsh -s /bin/zsh && sudo chsh -s /bin/zsh username Tmux Config This sets some ni...
Twitter and Facebook Popup Windows
I often find my self needing to add Twitter and Facebook share buttons. Usually not using the default widget icons. To do that you need some functions to call window.open and some jQuery to tie the links to those functions. These functio...
Some Rails Tips and Tricks
After doing a lot of refactoring today I wanted to note a few useful things I’ve picked up. load the rails environment for rake If you need to run a rake task that need access to the Rails models, etc. add the :environment dependency tas...
Rails AJAX Posts Session Reset
Notes regarding AJAX post requests being logged out on Rails. Seems the problem is not adding the CSRF data. The problem was that AJAX post requests resulted in a redirect to the login page. Further inspection showed the cookie was being...
Moving My Blog to the Toto Ruby Blog
I’ve decided to switch this blog off wordpress and go w/ something closer to the metal. Toto is a rack based blogging engine that uses markdown and basic test files. This is a good approach because you get complete control, but also an e...
Rails No Data Model
Take advantage of ActiveModel without a database backend. class NoDataModel include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming def initialize(attributes = {}) attributes.each do |name...
Notes On Capistrano to Windows 2008
http://www.petri.co.il/setup-ssh-server-vista.htm install openssh via cygwin, include vim and git. setup git in cygwin not windows if git for windows is installed, do not include use the git unix commands (remove from PATH if you install...
Savon.rb client for .Net web service.
This is a quick post to help anyone looking for info on consuming a dotNet based webservice using the savon gem for ruby. The main issue is that .net expects a namespace on the action element in the soap body. This can be done easily in ...
No, I can’t build Facebook for $500!
I’ve been freelancing full time for over a year now and have found that finding and bidding for new work takes a ton of time! The perception of what something should cost has moved far for reality. I’m wondering if other freelancers have...
Hacks and Hackers Colorado – April 27
Have an entrepreneurial streak? Want to be involved in innovative new technologies? Us too! Come checkout the inaugural Hacks and Hackers Colorado event April 27, at 6:30p!
AWS EC2 NodeJS, Forever, HAProxy Setup
Sign up for EC2 Create an instance, I used one from here, Alestic, paste in the ami-xxxxxx value to find the one you want. Create an security group with at least SSH and HTTP. Save your private key and connect like: ssh -i your_key.pem u...
NodeJS Web Applicaiton Links
Node API Docs and Resources More links from my recent NodeJS hacking. Node JS API 0.2.6 Express JS Expresso JS Node JS Modules Node Twilio Node Twilio Docs JS Reference from Mozilla Jade, Hmal like view engine Nodester Hosting
Node JS Notes
Getting Node Setup Node JS How To Node Download the latest package from Node JS tar -vxzf node-v0.2.6.tar.gz cd node-v0.2.6 ./configure make make install Package Manager How To Node NPM Hosting NodeFu Express npm install express npm inst...
Building Web Applications
I've been working on a series of posts on my consulting site, Red27.net, about building web applications. These posts are really focused toward less technical folks. However, I wanted to post about it here to get any additional feedback ...
Setting Up My Fujitsu ScanSnap S300 in Ubuntu 10.10
Mostly a post to help my future self and others trying setup a ScanSnap S300 in Ubuntu Things should mostly be setup by default, but there is one tricky bit. You need a file from the windows drivers. I had an old hard drive w/ my previou...
Tips from the MountainRB ruby on rails workshop
Yesterday I was at the MountainRB ruby workshop, which was basically an intro to rails class. It was a really good workshop and here are some tips I picked up. Cucumber Change the config/cucumber.yml file to display pretty output, making...
Resize/Clone a VirtualBox hard disk with the current snapshot
After wasting a ton of time, I’m noting this here to hopefully help myself or someone else in the future. Making the new virtual hard disk In VirtualBox open the virtual media manager and create a new disk with the larger size. Note it’s...
WordPress Quick Install and Setup On Ubuntu
Here’s some quick notes for installing WordPress on Ubuntu 10. Official install doc: http://codex.wordpress.org/Installing_WordPress I choose hosting on Linode, which has been an awesome experience so far, they have really good help guid...
AutoTest Powershell Script
This script will watch a source directory for changes, just *.cs files in this case and then execute a script when a change is detected. This handles the issue of the change event being triggered twice for one change. I’m just calling my...
ViEmu + ReSharper + VS2010 Review
I’ve been using the ViEmu plugin with ReSharper in VS2010 for a couple of weeks now. Overall, I really like combo. However there are a few things that annoy me with ViEmu. The selections modes are not the same between ViEmu and selecting...
Nhibernate Many-to-many mapping with an Enumeration on One Side
I’m posting this because I was trying to do this in an intuitive way and was thinking about it in the wrong way. A post on StackOverflow, Map to a list of enums, got me pointed in the right direction. I prefer using Enum’s in code, in p...
PowerVim, setup VIM to use Powershell
[https://candland.net/assets/images/binary/PowerVimsetupVIMtousePowershell_DAD5/vim_logo_2.png] I’m using VIM more and more and have come to the point where issuing commands to the shell would be useful, the problem is I use PowerShell. ...