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
class BadObject | |
def initialize | |
@internal = 'Coupling' | |
end | |
def perform | |
puts 'Start' | |
100.times do |i| | |
puts "Long Code ... #{i} #{@internal}" | |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
static inline uint32_t | |
bin_to_uint32(const uint8_t *bin) | |
{ | |
return (uint32_t)bin[0] << 24 | | |
(uint32_t)bin[1] << 16 | | |
(uint32_t)bin[2] << 8 | |
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
#include <stdint.h> | |
#include <stdio.h> | |
static inline uint32_t | |
bin_to_uint32(const uint8_t *bin) | |
{ | |
return (uint32_t)bin[0] << 24 | | |
(uint32_t)bin[1] << 16 | | |
(uint32_t)bin[2] << 8 | | |
(uint32_t)bin[3]; |
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
Puma caught this error: stack level too deep (SystemStackError) | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:174:in `each' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:174:in `as_json' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:58:in `as_json' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:175:in `block in as_json' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:174:in `each' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_support/core_ext/object/json.rb:174:in `as_json' | |
/Users/elct9620/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.1.1/lib/active_suppor |
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
import 'vendor/tinygo' | |
const go = new Go(); | |
go.importObject.env['main.defineClass'] = function(namePtr, nameLen, cPtr, cGcPtr, pPtr/*, pGcPtr*/) { | |
const mem = new DataView(go._inst.exports.memory.buffer) | |
const decoder = new TextDecoder("utf-8"); | |
const name = decoder.decode(new DataView(go._inst.exports.memory.buffer, namePtr, nameLen)); | |
const constructorID = mem.getUint32(cPtr, true) |
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
# frozen_string_literal: true | |
require 'bundler/inline' | |
require 'ostruct' | |
gemfile do | |
gem 'benchmark-ips' | |
end | |
GeoStruct = Struct.new(:latitude, :longitude) do |
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
[elct9620] test % wrk2 -t4 -c1000 -d30s -R1000 http://localhost:4000/ | |
Running 30s test @ http://localhost:4000/ | |
4 threads and 1000 connections | |
Thread calibration: mean lat.: 1425.090ms, rate sampling interval: 8970ms | |
Thread calibration: mean lat.: 1495.687ms, rate sampling interval: 9191ms | |
Thread calibration: mean lat.: 1444.798ms, rate sampling interval: 8970ms | |
Thread calibration: mean lat.: 1389.795ms, rate sampling interval: 8962ms | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 977.94ms 1.51s 9.22s 91.81% | |
Req/Sec 258.62 7.07 277.00 87.50% |
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
# frozen_string_literal: true | |
require "singleton" | |
class Settings | |
include Singleton | |
class << self | |
delegate_missing_to :instance | |
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
school = [ | |
%{ | |
name: "1A", | |
teacher: %{ | |
age: 28, | |
first_name: "Tricia", | |
last_name: "Garrett" | |
}, | |
assistants: %{ | |
age: 38, |
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 'csv' | |
require 'json' | |
require 'open-uri' | |
class Downloader | |
SCRIPT_URL = 'SCRIPT_URL' | |
attr_reader :uri | |
def initialize |