Skip to content

Instantly share code, notes, and snippets.

View id-ilych's full-sized avatar

Ilya Denisov id-ilych

View GitHub Profile
@Angeart
Angeart / lambda_traits.hpp
Last active April 2, 2021 13:17
how to get lambda return type
#pragma once
#include <tuple>
#include <type_traits>
namespace stx
{
namespace lambda_detail
{
template<class Ret, class Cls, class IsMutable, class... Args>
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@sue445
sue445 / uses_temp_dir.rb
Created June 5, 2014 14:18
Example of using temporary directory at rspec
shared_context :uses_temp_dir do
around do |example|
Dir.mktmpdir("rspec-") do |dir|
@temp_dir = dir
example.run
end
end
attr_reader :temp_dir
end