This file contains 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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package testjmx; | |
import java.lang.management.ManagementFactory; | |
import java.util.Random; | |
import javax.management.MBeanServer; |
This file contains 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
def func(param=[]): | |
param.append("test") | |
return param | |
assert func() == [ "test", ] | |
assert func() == [ "test", "test", ] | |
assert func() == [ "test", "test", "test" ] |
This file contains 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
perf record -F 99 -g -p $1 -- sleep 60 | |
perf script > out.perf | |
./FlameGraph/stackcollapse-perf.pl out.perf > out.perf.folded | |
./FlameGraph/flamegraph.pl out.perf.folded > dragent_flame.svg |
This file contains 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
class my | |
{ | |
public: | |
my() | |
{ |
This file contains 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
--- b/configure.ac 2014-11-08 15:27:56.000000000 +0100 | |
+++ a/configure.ac 2014-11-08 15:29:21.000000000 +0100 | |
@@ -2651,7 +2651,7 @@ | |
if test -n "$JAVA_CPPFLAGS"; then | |
JAVA_CPPFLAGS="-I${JAVA_CPPFLAGS}" | |
else | |
- JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I/System/Library/Frameworks/JavaVM.framework/Home/include -I/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers" | |
+ JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin" | |
fi | |
JAVA_LIBS="-framework JavaVM" |
This file contains 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
// schedule_read is called o start reading | |
void connection::connect() | |
{ | |
boost::asio::ip::tcp::resolver resolver(_io); | |
boost::asio::ip::tcp::resolver::query query(_hostname, std::to_string(_port)); | |
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query); | |
boost::system::error_code ec; | |
boost::asio::connect(_socket, iterator, ec); | |
if (ec) |
This file contains 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
simple_pool::ptr_t pool = simple_pool::create(); | |
// Calls block with a valid connection, retrying if something fails | |
pool->run_with_connection<void>([&](connection::ptr_t conn) | |
{ | |
conn->run(command("SET")("foo")("bar")); | |
}); |
This file contains 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
module Jekyll | |
class LessCssFile < StaticFile | |
def write(dest) | |
# do nothing | |
end | |
end | |
# Expects a lessc: key in your _config.yml file with the path to a local less.js/bin/lessc | |
# Less.js will require node.js to be installed |
This file contains 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
# ... | |
gem 'padrino-warden', :git => "git://github.com/zmack/padrino-warden.git" | |
gem 'authtools' |