Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/berkshelf/community_rest.rb b/lib/berkshelf/community_rest.rb
index 42c51d2..b791f23 100644
--- a/lib/berkshelf/community_rest.rb
+++ b/lib/berkshelf/community_rest.rb
@@ -75,6 +75,7 @@ def initialize(uri = V1_API, options = {})
options[:builder] ||= Faraday::RackBuilder.new do |b|
b.response :parse_json
b.response :gzip
+ b.response :follow_redirects
b.request :retry,
@charlesjohnson
charlesjohnson / gemrc.erb
Last active August 29, 2015 14:05
Use a .gemrc file with Omnibus chef-client
:sources:
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/
@marcinb
marcinb / bbc_recipes.coffee
Created October 7, 2011 11:23
Chicken soup recipes
page = require('webpage').create()
injectjQuery = ->
# phantom allows to dynamically inject any javascript
# into page context.
# Make sure you add jquery to your script dir.
page.injectJs './jquery.js'
# ALWAYS do that when injecting jQuery into other page
page.evaluate ->
/**
* Copyright (c) 2011 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
* implied, including the implied warranties of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
* along with this software; if not, see
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
@chowey
chowey / syntax.js
Created February 18, 2012 22:32
Jade Syntax Checker
var jade = require('jade'),
runtime = require('jade/lib/runtime'),
spawn = require('child_process').spawn,
fs = require('fs');
function parse(str, filename){
var options = {filename: filename, compileDebug: true};
try {
// Parse
var parser = new jade.Parser(str, filename, options)
@sperlic
sperlic / fabfile.py
Created May 13, 2012 10:01 — forked from whiteinge/fabfile.py
Example fabric script with VirtualBox automation
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@fnichol
fnichol / 00_README.md
Created December 20, 2012 06:36
Chef Metadata Chopper!

MetadataChopper

MetadataChopper.extract('metdata.rb') # => [ "rvm", "0.9.1" ]
@Hydrotoast
Hydrotoast / AdversarialSearchAI.java
Last active December 10, 2015 15:18
An pseudocode AI demonstrating the Minimax algorithm. Note that the algorithm has two helper functions: min and max.
class AdversarialSearchAI {
private PieceType piece;
public AdversarialSearchAI(PieceType piece) {
this.piece = piece;
}
/**
* Returns the best move given the state of the game
*/
What kind of new features would you be happy to see in Apache Maven new major release ?