Skip to content

Instantly share code, notes, and snippets.

View maxmanders's full-sized avatar

Max Manders maxmanders

View GitHub Profile
common_packages = %w(python-setuptools python-dev)
case node['platform']
when "centos", "redhat", "amazon"
(common_packages + ['gcc']).each do |pkg|
package pkg do
action :install
end
end
when "debian", "ubuntu"
(common_packages + ['build-essential']).each do |pkg|
rake routes | grep group
group_index GET /group(.:format) group#index
POST /group(.:format) group#create
new_group GET /group/new(.:format) group#new
edit_group GET /group/:id/edit(.:format) group#edit
group GET /group/:id(.:format) group#show
PATCH /group/:id(.:format) group#update
PUT /group/:id(.:format) group#update
DELETE /group/:id(.:format) group#destroy
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
my %results = ();
my $keyspace = 'None';
my $table = 'None';
while (<>) {
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
my %results = ();
my $keyspace = 'None';
my $table = 'None';
while (<>) {
<style type="text/css">
div.container {
width: 100%;
}
div.container table {
width: 600px;
}
table th {
text-align: right;
width: 150px;
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::*"
class Group < ActiveRecord::Base
  validates :name, :presence => true
end
@maxmanders
maxmanders / gist:2f8c0d185f2d7ee70831
Created November 19, 2014 19:47
Spreadsheet Bracket Hell
(A45=Applications!B45,
if(Applications!P45='Risk Criteria'!$K$3,
'Risk Criteria'!$L$3,
if(Applications!P45='Risk Criteria'!$K$4,
'Risk Criteria'!$L$4,
if(Applications!P45='Risk Criteria'!$K$5,
'Risk Criteria'!$L$5,
if(Applications!P45='Risk Criteria'!$K$6,
'Risk Criteria'!$L$6,
"else clause"
Rails.application.routes.draw do
namespace :api, :path => "", :constraints => { :subdomain => "api" }, :defaults => { :format => :json } do
namespace :v1 do
resources :users
get '/echo/:message', to: 'status#echo'
end
end
$ curl -XGET -H "Content-Type: application/json" -H "Accept: application/json" "http://api.example.dev:13000/v1/echo/wibble"
{"message":"wibble"}%