Skip to content

Instantly share code, notes, and snippets.

View wchrisjohnson's full-sized avatar

Chris Johnson wchrisjohnson

View GitHub Profile
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
@wchrisjohnson
wchrisjohnson / performance.markdown
Created October 17, 2011 19:52 — forked from jcasimir/performance.markdown
Measuring Performance

Measuring Performance

Performance is often ignored in Rails development until it becomes a problem. If ignored too long, though, it can get very tricky to improve. It's valuable to regularly audit performance and look for hotspots or design choices that are slowing things down.

Inspecting the Logs

Inspecting the log will help identify the source of several performance issues the application may have.

The Rails application log outputs the time spent processing each request. It breakdowns the time spent at the database level as well processing the view code. In development mode, the logs are displayed on STDOUT where the server is being run. In a production setting the logs will be in log/production.log within the application's root directory.

@wchrisjohnson
wchrisjohnson / guard
Created July 2, 2012 14:43
Guard file with Spork support
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
require "fog/openstack/rackspace/version"
module Fog
module Openstack
module Rackspace
class Identity < Fog::Service
US_ENDPOINT = 'https://identity.api.rackspacecloud.com/v2.0'
UK_ENDPOINT = 'https://lon.identity.api.rackspacecloud.com/v2.0'
requires :rackspace_username, :rackspace_api_key
require 'multi_json'
require 'fog/core'
require 'fog/openstackcommon/identity/adapters/authenticator_v2'
module Fog
module HpTng
module Authentication
module Adapters
module AuthenticatorV2
module SomeRequest
class Real
def do_something
RequestCommon.base_request(...)
end
end
end
@wchrisjohnson
wchrisjohnson / fix-homebrew-npm.md
Created March 9, 2016 07:03 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@wchrisjohnson
wchrisjohnson / node-and-npm-in-30-seconds.sh
Created March 9, 2016 08:37 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@wchrisjohnson
wchrisjohnson / docker-machine-vmfusion.sh
Created March 10, 2016 02:10
Basic workflow for docker-machine on Mac with VMWare Fusion
# Get everything ready on a Mac
brew install docker docker-machine docker-compose
# Create a new machine (based on the 1.8.1 boot2docker iso)
docker-machine create --driver vmwarefusion --vmwarefusion-memory-size 2048 --vmwarefusion-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso osxdock
# Bring the machine up
docker-machine start osxdock
# Configure Shell
Thu Jun 16 03:48:29 UTC 2016