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
log_format json '{' | |
'"host": "lb01", ' | |
'"status": "$status", ' | |
'"scheme": "$scheme", ' | |
'"uri": "$request_uri", ' | |
'"args": "$args", ' | |
'"dest_host": "$http_host", ' | |
'"content_type": "$sent_http_content_type", ' | |
'"protocol": "$server_protocol", ' | |
'"referer": "$http_referer", ' |
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
// Given | |
struct StackFrame { | |
VALUE* locals | |
} | |
N = local wanted | |
$1 = load getelementptr %struct.StackFrame, *%struct.StackFrame, 0, 0, N |
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
Laying in bed completely still, imagine yourself laying on the beach. | |
Feel yourself sunk slightly into the warm sand. | |
Feel the hot sun warming your body slightly, then a cool breeze wafts over you. | |
Hear the ocean just over the rise, the waves breaking on the beach. | |
Feel yourself sink into the sand a little more. As you do, feel your feet relax. |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"runtime/pprof" | |
) | |
func main() { | |
f, err := os.Create("test.pprof") |
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
def foo(a : String) | |
# the method prologue is injected with | |
raise TypeError unless String === a | |
end | |
# Allows for other interesting ones, like: | |
def use_as_number(a : /\d+/) | |
end |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"syscall" | |
) | |
const path = "/home/vagrant/blah" |
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
num_threads = (ARGV[0] || 2).to_i | |
num_iterations = (ARGV[1] || num_threads).to_i | |
def url_helpers | |
Module.new do | |
class << self | |
# This line changes everything. It causes the GIL to switch to another | |
# thread. That other thread mutates the CREF that is accidentally shared | |
# between these independent sclass scopes, causing the def below to add | |
# the method on an entirely different sclass. |
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
irb(main):003:0> require 'socket' | |
=> true | |
irb(main):004:0> s = TCPServer.new 9999 | |
=> #<TCPServer:fd 10> | |
irb(main):005:0> Thread.new { s.accept } | |
=> #<Thread:0x007fedf33f0e88 run> | |
irb(main):006:0> c = TCPSocket.new "0.0.0.0", 9999 | |
=> #<TCPSocket:fd 11> | |
irb(main):007:0> Process.fork { p $$ } | |
on_fork: Detected open IO at fork: #<TCPServer:0x007fedf33e8f08> |
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 'benchmark' | |
require 'benchmark/ips' | |
outer_b = 0 | |
Benchmark.ips do |x| | |
outer_a = 0 | |
x.report "inner a block" do | |
inner_a = 1 | |
end |
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
type A interface { | |
Foo() int | |
} | |
type B interface { | |
Foo() int | |
} | |
type D interface { | |
Report(a A) |