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
- layout: title | |
content: | | |
# Pry | |
- content: | | |
# Installation | |
### Global | |
```console |
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
from dataclasses import dataclass | |
from typing import Literal, Protocol, Optional | |
class Side: | |
... | |
class Wombat: | |
... |
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
#!/usr/bin/env ruby | |
require "json" | |
require "net/http" | |
require "uri" | |
require "irb" | |
sentry_auth_token = ENV.fetch("SENTRY_AUTH_TOKEN") |
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
# https://codingdojo.org/kata/Args/ | |
require "minitest" | |
class TestArgs < Minitest::Test | |
def test_args | |
parser = ArgsParser.new(l: :bool, p: :int, d: :str) | |
args = parser.parse(*%w[-l -p 8080 -d /usr/logs]) |
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
https://github.com/qmacro/level-up-your-json-fu-with-jq/blob/main/talknotes.md | |
pbpaste | from json | |
pbpaste | save environment.json | |
# jq '.availableEnvironments|length' environments.json | |
open environment.json | get availableEnvironments | length | |
# jq -r '.[].name' offerings.json |
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
array5<array5<int5>> X; | |
X.each(function (row) { | |
row.each(function (cell) { | |
invariant cell.between?(1, 5); | |
}); | |
}); | |
function valid?(ary) { | |
invariant ary.uniq?; |
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 | |
source "https://rubygems.org" | |
gem "jasmine", git: "https://github.com/jasmine/jasmine-gem.git", branch: "main" |
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
extension Int { | |
var bcd: [UInt8] { | |
var d: [UInt8] = [] | |
var n = self | |
while n > 0 { | |
let (q, r) = n.quotientAndRemainder(dividingBy: 100) | |
let (hundreds, tens) = r.quotientAndRemainder(dividingBy: 10) | |
d.append(UInt8((hundreds << 4) | tens)) | |
n = q | |
} |
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
#!/usr/bin/env ruby -w | |
require "openssl" | |
FLD_DIGIT_SHIFT = 6; | |
FLD_DIGIT_MASK = (0b111 << FLD_DIGIT_SHIFT); | |
FLD_NUMSECONDS_SHIFT = 0; | |
FLD_NUMSECONDS_MASK = (0b11 << FLD_NUMSECONDS_SHIFT); | |
def bcd(str) |
NewerOlder