Skip to content

Instantly share code, notes, and snippets.

View shanepinnell's full-sized avatar
🏠
Working from home

Shane Pinnell shanepinnell

🏠
Working from home
View GitHub Profile
@scriptingosx
scriptingosx / ard_installcheck.sh
Created January 14, 2016 11:43
Control ARD scripts
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki export PATH
# this will run as a munki install_check script
# exit status of 0 means install needs to run
# exit status not 0 means no installation necessary
# adapted scripts from here: https://jamfnation.jamfsoftware.com/discussion.html?id=1989
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@purcell
purcell / application_helper.rb
Created September 9, 2011 09:23
Make will_paginate generate HTML that bootstrap.less will render nicely
# Based on https://gist.github.com/1182136
class BootstrapLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag :div, tag(:ul, html), container_attributes
end
def page_number(page)
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page)