This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet' | |
require 'puppet/network/http_pool' | |
require 'uri' | |
url = URI.parse('https://localhost:443/reports/upload') | |
headers = { "Content-Type" => "application/x-yaml" } | |
body = <<HELLO | |
--- !ruby/object:Puppet::Transaction::Report | |
metrics: | |
resources: !ruby/object:Puppet::Util::Metric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Just trying out more functional programming in PHP | |
* This gist provides some basic utility functions for: | |
* + Working with functions | |
* + Working with arrays | |
*/ | |
// This function allows creating a new function from two functions passed into it | |
function compose(&$f, &$g) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is by no means complete, but it's a sketch of an idea I had to create a | |
* classless functional style framework for PHP. | |
* | |
* It might turn out to be something cool! | |
*/ | |
// This function allows creating a new function from two functions passed into it | |
function compose(&$f, &$g) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fibonacci: | |
*============================================================================ | |
* Class for computing fibonacci numbers using functional programming in PHP | |
* Uses the formula at: http://jburrows.wordpress.com/2009/12/30/fibonacci/ | |
*/ | |
class fibonacci { |
NewerOlder