Skip to content

Instantly share code, notes, and snippets.

View ryanjm's full-sized avatar

Ryan Mathews ryanjm

View GitHub Profile

Test

  • Click the Setup tab: It is located in the menu bar and will only be accessible to Administrators.
  • Click the Setup tab: It is located in the menu bar and will only be accessible to Administrators.
@ryanjm
ryanjm / arrayLastObjects
Created May 9, 2015 18:26
Swift Extension for Array
extension Array {
// Underscore is to opt out of Swift forcing an external name for
// the default property.
func lastObjects(_ c:Int = 1) -> Array? {
if (c == 0) {
return Array()
}
else if (c < 0) {
return nil
}

Keybase proof

I hereby claim:

  • I am ryanjm on github.
  • I am ryanjm (https://keybase.io/ryanjm) on keybase.
  • I have a public key whose fingerprint is 77EC FDF8 8283 E0B4 085C 518A 98E7 BF7A 2B88 B73E

To claim this, I am signing this object:

@ryanjm
ryanjm / gist:307996
Created February 18, 2010 20:07
Installing Nokogiri
I had an issue with getting nokogiri working with various gems and plugins, such as
bundler. This is the steps I took to get it working. I've used macports on this
machine and I uninstalled it a few days, trying to use homebrew.
Uninstall all previous versions of nokogiri
If you're using brew then make sure you have libxml2 installed
brew install libxml2
Then create a sim link
@ryanjm
ryanjm / SSH Password
Created February 26, 2010 05:34
Shortcut for accessing ssh
I set up my ssh such that I don't have to put in the password every time and that I have a shortcut to get to the remote machine.
In this case I'm logging into a school computer named csil. So I made an alias:
alias csil='ssh csil'
This calls on ~/.ssh/config which looks like this:
Host csil
HostName address.to.remote.computer
User username
@ryanjm
ryanjm / Setting up Linux
Created February 27, 2010 00:02
Simply customizing shell
I wanted to customize the linux box I have to log into.
First I changed my zsh profile:
In my .zshrc file:
PROMPT="[csil]%~%# "
In order to get zsh to load by default I found out which shell it was running:
echo $SHELL
$/bin/tcsh
After do |scenario|
if scenario.failed? && scenario.exception.is_a?(Webrat::NotFoundError)
save_and_open_page
end
end
@ryanjm
ryanjm / .gitignore for XCode project
Created February 9, 2011 16:42
Commands I forget often
# http://blog.illuminex.com/2009/10/better-sample-gitignore-file-for-xcode.html
# Mac OS X Finder and whatnot
.DS_Store
# Sparkle distribution Private Key (Don't check me in!)
dsa_priv.pem
@ryanjm
ryanjm / New Mac setup
Created February 26, 2011 02:30
Things to do / install when getting a new mac
Set your password
Put in Apple Account
Chrome
Setup Mail
Mac Software Updates
Evernote - app store
Alfred - app store
- Change spotlight shortcut and set command+space as alfred
Setup caps lock to be control
Caffeine - lighthead - app store
@ryanjm
ryanjm / Rails CMS alternatives
Created June 13, 2011 22:48
List of Rails CMS software
Rails CMS alternatives
======================
I've updated this as of 6/14/11. Looking at only active projects
Active projects:
---------------
BrowserCMS
repo: http://github.com/browsermedia/browsercms
site: http://www.browsercms.org/