Skip to content

Instantly share code, notes, and snippets.

View ppg's full-sized avatar

Peter P. Gengler ppg

View GitHub Profile
@jmtatsch
jmtatsch / setup.sh
Last active March 15, 2017 13:00 — forked from mikepurvis/gist:9837958
Install ROS Jade on OS X El Capitan
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they
# are definitely not suitable for dumping to a giant script and running as one. If you
# use them, they should be run one at a time, with an eye out for errors or problems
# along the way.
#
# The #1 issue you are likely to encounter is with Homebrew or Python packages whose
# binary components link against system Python. This will result in runtime segfaults,
# especially in rviz. If you suspect this is occurring, you can attempt to remove and
# reinstall the offending packages, or go for the nuclear option--- empty your Cellar
# and site-packages folders and start over with brewed python from the beginning.
@steeve
steeve / _readme.md
Last active March 7, 2024 12:38
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@kizzx2
kizzx2 / post.rb
Last active June 26, 2021 12:14
A clean and elegant approach to partial object validation with Rails + Wicked wizards (using session to store the partial object)
class Post < ActiveRecord::Base
attr_accessible :body, :price, :title
validates_presence_of :title
validates_length_of :title, minimum: 10
validates_presence_of :body
validates_numericality_of :price, greater_than: 0
end
@innotekservices
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@joshed-io
joshed-io / example_group.rb
Created July 14, 2011 01:16
Easiest possible RSpec Performance Test w/ Scenarios
# here's a quick recipe to run a performance test
# with this method, you can:
#-> easily choose the examples you want included from your existing specs
#-> define the target number of total iterations you'd like, no limit
#-> tune the transaction mix by specifying frequency metadata for each example
#-> be happy that the transaction mix is fairly homogeneous over the test interval
# (ideally you'd run this with acceptance (webrat/capybara) specs, but you
# could employ this technique for any rspec test)
@dblock
dblock / delayed_jobs_controller.rb
Created June 4, 2011 20:06
Delayed job view and controller
class Admin::DelayedJobsController < AdminController
# GET /admin/delayed_jobs
def index
@delayed_jobs = Delayed::Backend::Mongoid::Job.desc(:created_at)
.paginate :page => params[:page], :per_page => 20
end
end
@rdetert
rdetert / application.html.erb
Created March 1, 2011 06:28
How to logout completely from Facebook using Ruby on Rails and Devise + Omniauth. I'm just modifying the Omniauth Railscast http://railscasts.com/episodes/236-omniauth-part-2
<div id="user_nav">
<% if user_signed_in? %>
<img src="<%= user_avatar %>" id="main_avatar"> Signed in as <%= current_user.email %>.<br />
Not you?
<% if session[:fb_token].nil? %>
<%= link_to "Sign out", destroy_user_session_path %>
<% else %>
<%= link_to "Sign out", facebook_logout_path %>
<% end %>
@botchagalupe
botchagalupe / gist:796787
Created January 26, 2011 15:02
Rundeck with Chef

Make sure the EC2 instance for the Rundeck server has ports 4440 and 4443

Get the JAR files from github

wget https://github.com/downloads/dtolabs/rundeck/rundeck-launcher-1.1.0.jar --no-check-certificate

Install Java

sudo apt-get install openjdk-6-jre 
@kineticac
kineticac / Example of a "cron" delayed_job
Created November 17, 2010 20:45
Here's a quick way to run a delayed_job job like a cron job. The ensure block is the key to making sure it runs again.
class SampleJob
def perform
begin
# do all your work in the begin block.
puts "hello world"
rescue Exception => e
# rescue any errors so that you know something went wrong. Email yourself the error if you need.
error_msg = "#{Time.now} ERROR (SampleJob#perform): #{e.message} - (#{e.class})\n#{(e.backtrace or []).join("\n")}"
puts error_msg
ensure