Python
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
# Gawk version | |
# Remote | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
# No Gawk | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
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
#!/usr/bin/env bash | |
~/src/scratch/manageiq/extract_provider_gem.sh \ | |
-n ovirt \ | |
-d "app/models/manageiq/providers/redhat spec/models/manageiq/providers/redhat spec/vcr_cassettes/manageiq/providers/redhat" \ | |
-l \ | |
-e ~/src/manageiq \ | |
-r \ | |
-g ~/src/manageiq \ | |
-p durandom \ |
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
testruby.bundle: testruby.cr | |
crystal testruby.cr --link-flags "-dynamic -bundle -Wl,-undefined,dynamic_lookup" -o testruby.bundle | |
irb: testruby.bundle | |
irb -rtestruby -I. | |
clean: | |
rm -rf .crystal testruby.bundle |
Crystal 0.9.1 with Kemal
require "kemal"
ws "/" do |socket|
socket.on_message do |message|
end
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
$ ruby --version | |
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux] | |
$ ruby benchmark.rb | |
user system total real | |
RedCarpet 0.220000 0.000000 0.220000 ( 0.227063) | |
kramdown 52.250000 0.000000 52.250000 ( 52.328927) | |
marked.js 3.660000 0.020000 3.680000 ( 3.632203) | |
# Machine: |
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
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb | |
index 2dff37f..25e5623 100644 | |
--- a/spec/spec_helper.rb | |
+++ b/spec/spec_helper.rb | |
@@ -76,6 +76,25 @@ RSpec.configure do |config| | |
} | |
config.include RakeTaskExampleGroup, :type => :rake_task | |
+ config.before(:suite) do | |
+ $counts_by_example = {} |
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
diff --git a/Gemfile b/Gemfile | |
index 90b36f7..75077b4 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -4,6 +4,8 @@ eval_gemfile(File.expand_path("gems/pending/Gemfile", __dir__)) | |
# VMDB specific gems | |
# | |
+gem 'influxdb' | |
+ |
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 AROpts | |
module Helpers | |
def GT(val); AROpts::GT.new(val); end | |
def LT(val); AROpts::LT.new(val); end | |
def GTE(val); AROpts::GTE.new(val); end | |
def LTE(val); AROpts::LTE.new(val); end | |
end | |
GenericOp = Struct.new(:expression) |
NewerOlder