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 | |
module Fingerprinting | |
def full_fingerprint | |
generate_fingerprint( | |
ip_fingerprint, | |
browser_fingerprint | |
) | |
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
render TableComponent.new(@posts) do |t| | |
t.column("Title", &:title) | |
t.column("Author") { |post| post.author.name } | |
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
module Murmur | |
MASK32 = 0xffffffff | |
def self.hash(str, seed = 0) | |
# Initialize variables | |
# h1: The main hash value that will be iteratively updated | |
# k1: A temporary value used to process chunks of 4 bytes | |
# i: Counter to keep track of the number of bytes processed | |
h1 = seed | |
k1 = 0 |
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
[ | |
{ | |
"context": "Editor", | |
"bindings": { | |
"alt-up": "editor::SelectLargerSyntaxNode", | |
"alt-down": "editor::SelectSmallerSyntaxNode", | |
"ctrl-cmd-up": "editor::MoveLineUp", | |
"ctrl-cmd-down": "editor::MoveLineDown" | |
} | |
} |
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 | |
class Components::Gravatar < Ode::Base | |
include Flecks | |
prop :size, Integer, default: 80 | |
prop :alt, String | |
prop :email, String do |value| | |
value.to_s.strip.downcase | |
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
class FuzzyIndex | |
def initialize | |
@index = Hash.new { |h, k| h[k] = Set.new } | |
end | |
def []=(key, value) | |
trigrams(key).each { @index[it] << [key, value] } | |
end | |
def [](query) |
OlderNewer