Skip to content

Instantly share code, notes, and snippets.

knowledgecenter /knowledgecenter(.:format) {:action=>"knowledgecenter", :to=>#<Proc:0x0000000604c238@/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.10/lib/action_dispatch/routing/mapper.rb:366 (lambda)>}
knowledge_center /knowledge_center(.:format) {:action=>"knowledge_center", :to=>#<Proc:0x0000000602bc18@/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.10/lib/action_dispatch/routing/mapper.rb:366 (lambda)>}
render :update do |page|
page.replace_html 'divCommunityTeamEditor', :partial => '/communities/invite_team_member'
page << "$('#divCommunityTeamMembers').hide();$('#divCommunityTeamEditor').show(); $('#cTeamPW').hide();"
end
def find_associate_common user_ids
# search types
@selected_types = []
@selected_types << 'User'.constantize
# default fields to search
@default_assoc_search_fields = ['last_name_text', 'first_name_text', 'middle_name_text', 'email_text', 'city_region_text', 'country_text']
@search_all_profile = params[:search_all_profile] ||= false
@alanstevens
alanstevens / newgemset.sh
Last active September 28, 2015 21:39
A shell script for creating a new gemset. The default gemset name is the current working directory but there is an optional parameter for creating a custom gemset name
#!/usr/bin/env bash
readonly rubyversion="1.9.3"
# Source RVM as a function into local environment.
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
@alanstevens
alanstevens / install-rvm.sh
Last active September 28, 2015 21:58
Shell script to install rvm and rails
#!/bin/bash
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
rvm autolibs enable
rvm install 1.9.3
rvm use 1.9.3 --default
rvm use 1.9.3@global
echo "install: --no-rdoc --no-ri" >> ~/.gemrc
echo "update: --no-rdoc --no-ri" >> ~/.gemrc
@alanstevens
alanstevens / OSX_Lion_NTFS_support
Created January 2, 2012 00:05 — forked from zwned/OSX_Lion_NTFS_support
NTFS Support Mac OSX Lion
brew install fuse4x
brew install ntfs-3g
sudo kextunload -b org.fuse4x.kext.fuse4x
sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.0/Library/Extensions/fuse4x.kext /Library/Extensions
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
sudo touch /sbin/mount_ntfs
@alanstevens
alanstevens / Install-Mac-Ctags.sh
Last active September 30, 2015 14:18
Script to install exuberant ctags so I don't have to Google it next time.
#!/bin/bash
curl -O http://superb-dca3.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz
tar xzvf ctags-5.8.tar.gz
cd ctags-5.8
./configure
make
sudo make install
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
@alanstevens
alanstevens / gist:1909640
Created February 25, 2012 17:29
Script to setup the web server for Rails on an Ubuntu server
#!/bin/bash
#
# Install nginx & passenger build dependencies
#
apt-get install libcurl4-openssl-dev --yes
apt-get install libpcre3 libpcre3-dev --yes
#
# source rvm in the current shell session
@alanstevens
alanstevens / install_system_rvm.sh
Last active October 1, 2015 03:18 — forked from tsykoduk/rvm_systemizer_setup.sh
Shell script to install rvm at the system level.
#!/usr/bin/env bash
#
# execute with:
# curl https://gist.github.com/alanstevens/1909971/raw/install_system_rvm.sh|bash
#
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
@alanstevens
alanstevens / gist:2764397
Created May 21, 2012 20:17
Script to setup ruby and user accounts on a RPM box
#!/usr/bin/env bash
#
# execute this script with:
# curl https://raw.github.com/gist/2764397/gistfile1.sh | sudo bash
#
function add_user(){
local user_name=$1
local public_key=$2