Skip to content

Instantly share code, notes, and snippets.

class imageserver {
class { "users": }
class { "bashrc": }
class { "packages": }
class { "gems": }
class { "apache2": }
}
node "ip-xx-xx-xx-xx.eu-west-1.compute.internal" {
class { "imageserver": }
describe( "setFailed()", function() {
var imageBox = new ImageBox( widget, boxesList );
var element = new MockElement();
var subject = function() { imageBox.setFailed(); return imageBox; }
beforeEach( function() {
widget.imageBoxes = [ {}, imageBox, {} ];
imageBox.element = element;
spyOn( element, "removeClass" );
ImageBox.prototype.setFailed = function() {
var self = this;
this.element.removeClass( "uploading" );
this.element.addClass( "failed" );
this.state = "failed";
this.element.delay( 2000 ).fadeOut( 300, function() {
self.element.remove();
self.widget.imageBoxes.splice( self.widget.imageBoxes.indexOf( self ), 1 );
self.widget.populateImageBoxes();
self.widget.setSelectionBox();
#include "gmock/gmock.h"
#include <iostream>
#include <string>
#include <memory>
namespace poc {
using namespace std;
struct IPoc1
{
/* Compile with:
* $CXX -std=gnu++11 -pthread -Wall -g -D_GLIBCXX_USE_NANOSLEEP -I/usr/local/include queuetest.cpp -o queuetest
*
* Where $CXX points to a G++ compiler, version 4.7
*/
#include <memory>
#include <thread>
#include <queue>
#include <mutex>
@biot023
biot023 / gist:2318842
Created April 6, 2012 10:54
Failing cppcms build
~/src/cppcms-1.0.1/build$ make
[ 0%] Building CXX object booster/CMakeFiles/booster.dir/lib/ptime/src/posix_time.cpp.o
[ 0%] Building CXX object booster/CMakeFiles/booster.dir/lib/ptime/src/ctime.cpp.o
[ 1%] Building CXX object booster/CMakeFiles/booster.dir/lib/regex/src/pcre_regex.cpp.o
[ 1%] Building CXX object booster/CMakeFiles/booster.dir/lib/system/src/posix_error.cpp.o
[ 1%] Building CXX object booster/CMakeFiles/booster.dir/lib/system/src/windows_error.cpp.o
[ 2%] Building CXX object booster/CMakeFiles/booster.dir/lib/aio/src/aio_category.cpp.o
[ 2%] Building CXX object booster/CMakeFiles/booster.dir/lib/aio/src/deadline_timer.cpp.o
[ 2%] Building CXX object booster/CMakeFiles/booster.dir/lib/aio/src/endpoint.cpp.o
[ 3%] Building CXX object booster/CMakeFiles/booster.dir/lib/aio/src/io_service.cpp.o
class HealthCheckController < ApplicationController
##
# GET health-check
#
def index
if Typhoeus::Request.get( "#{ SearchExec.server }/#{ SearchExec.index }/_status" ).success?
render( :text => "OK", :status => 200 )
else
render( :text => "Fail", :status => 500 )
@biot023
biot023 / gist:1496130
Created December 19, 2011 08:44
Full NULL pointer given exception
A ArgumentError occurred in health_check#index:
NULL pointer given
/usr/lib/ruby/gems/1.8/gems/typhoeus-0.3.2/lib/typhoeus/easy.rb:371:in `easy_getinfo_string'
-------------------------------
Request:
-------------------------------
* URL : http://www.myapp.com/health-check
@biot023
biot023 / gist:1493658
Created December 18, 2011 15:08
operator_test.cpp test output
~/work/cpp/rtga$ rake test FILTER="SingleConnectionOperatorTest.*"
g++-mp-4.6 -Wall -g -std=c++0x -c -I./include -I/Users/douglivesey/src/gmock/include -I/Users/douglivesey/src/gmock/gtest/include -o test/test_runner.o test/test_runner.cpp
g++-mp-4.6 -Wall -g -std=c++0x -c -I./include -I/Users/douglivesey/src/gmock/include -I/Users/douglivesey/src/gmock/gtest/include -o test/unit/rtga/array_test.o test/unit/rtga/array_test.cpp
g++-mp-4.6 -Wall -g -std=c++0x -c -I./include -I/Users/douglivesey/src/gmock/include -I/Users/douglivesey/src/gmock/gtest/include -o test/unit/rtga/connection_net_test.o test/unit/rtga/connection_net_test.cpp
g++-mp-4.6 -Wall -g -std=c++0x -c -I./include -I/Users/douglivesey/src/gmock/include -I/Users/douglivesey/src/gmock/gtest/include -o test/unit/rtga/connection_test.o test/unit/rtga/connection_test.cpp
g++-mp-4.6 -Wall -g -std=c++0x -c -I./include -I/Users/douglivesey/src/gmock/include -I/Users/douglivesey/src/gmock/gtest/include -o test/unit/rtga/exec_test.o test/unit/rtga/exec_tes
#include "gtest/gtest.h"
#include "rtga/operator.h"
#include "rtga/rtga.h"
#include <vector>
#include <memory>
using namespace std;
using namespace rtga;
template <typename T>