Skip to content

Instantly share code, notes, and snippets.

-----BEGIN PGP MESSAGE-----
hQEMA8MeMF20Q5DgAQf9EW/kWrHuhWR1aN99TKQeBJUUE/B0tgvG5CTpziK7wXoF
TcMir8pkRA3gCzRf3N6Y5qnDLAGhmdHKCu1wNAcO5nq+bY+XLCQnByePzgEPZbej
y5G4w/r7Sl1v5RNSsLEPH3F0cmSs4ESA8w/jyVhePIzx+8+8Y1BeT7RvEEzqheag
hi8suEq58x3dEhUlbsGmTpzRLzP5uKcZgaNLmPZ3G9fjEeGzCc5pXcZnFfx+l9aQ
2tPHdnoopNA5QeuYUHHk1grsBQp3NjEL+rem5gjr36lPVN7pIY5bnXd/VNPRaeom
DTaiAfKyNgDcMroRRys0IoCKIMafyXK3kSZGyr14iIUBDANFzOuSVFyk3wEIALPQ
qbF4ejtP/m6ReplaDj4zCKR/ol3qydmIB3t6FsWUYA4wiIJ6ATGo/JAOd7wPvdNc
3VYbMBBXDyB5zfpoGLM7QjFPJ+vSR+qxbERTrMLAD8Z7xRGGikrpgYnasg7N8l/V
{"CollectionObject":{"_accessionNumber":"35.108.2","<CRDID>k__BackingField":223068,"<CollectionObjectId>k__BackingField":223068,"<Title>k__BackingField":"Panel","<ObjectName>k__BackingField":"Panel","<CRDDepartmentId>k__BackingField":1,"<CRDDepartmentSortOrder>k__BackingField":0,"<CRDPackageIds>k__BackingField":[1],"<CreditLine>k__BackingField":"Gift of Mrs. R.W. de Forest, 1935","<CreditLineReproduction>k__BackingField":null,"<Dimensions>k__BackingField":"L. 20 x W. 15 inches\r\n50.8 x 38.1 cm","<DateText>k__BackingField":"19th century","<DateBegin>k__BackingField":1800,"<DateEnd>k__BackingField":1899,"<Classification>k__BackingField":"Textiles","<SubClassification1>k__BackingField":null,"<SubClassification2>k__BackingField":null,"<SubClassification3>k__BackingField":null,"<SortOrder>k__BackingField":0,"<Medium>k__BackingField":"Drawnwork","<Culture>k__BackingField":"Mexican","<Period>k__BackingField":"","<Dynasty>k__BackingField":"","<Reign>k__BackingField":"","<Geography>k__BackingField":[{"<CRDID>k__Backi
@calebhearth
calebhearth / _result
Last active September 19, 2016 19:52
❯ go run main.go
222224
# a few seconds pass
^Csignal: interrupt
[8:46 AM]
Caleb Thompson Is this the direction you were thinking? https://github.com/rails/rails/compare/master...calebthompson:null-constraint-errors-are-turned-into-validation-errors
[9:11 AM]
Sean Griffin Almost, yeah. There should be a field on the `PG::NotNullViolation` error that references the column(s) that were violated. If it's not exposed, we should make a PR to the pg gem exposing it
[9:12 AM]
(For unique constraint violations it's going to give the constraint name not the column name -- but I'd rather parse that than the error message)
[9:12 AM]
{
  "title": "The Building Built on Stilts",
  "name": "Nickolas Means",
  "twitter": "nmeans",
  "url": "http://nickol.as",
  "company": "Muve Health",
  "abstract": "In the summer of 1978, structural engineer William LeMessurier got a phone call that terrified him. An undergraduate student claimed that LeMessurier's acclaimed 59-story Citicorp Center in Manhattan, just completed the year prior, was dangerously unstable under certain wind conditions. The student was right, and it was almost hurricane season.\n\nInnovation always brings risk of significant mistakes because you're venturing into the unknown. The key to building a culture of innovation in your team is learning how to respond when those mistakes happen. Let's let Bill LeMessurier teach us how to respond when it all goes wrong so that our creations can thrive despite our mistakes.",
  "bio": "Coder, truth-seeker, functional impostor. VP of Engineering at WellMatch Health."
}
#!/bin/sh
# NAME
# git-catchup - Rebase onto a "mainline" branch.
#
# SYNOPSIS
# git catchup [<repository> <refspec>]
# git catchup <refspec>
#
# DESCRIPTION
class EmptyQueue
def initialize(company)
@company = company
end
def reasons
[
{
no_accounts: -> { company.accounts.none? },
no_approved_content: -> { company.approved_contents.none? },
#!/bin/sh
# NAME
# git-catchup - Rebase onto a "mainline" branch.
#
# SYNOPSIS
# git catchup [<repository> <refspec>]
# git catchup <refspec>
#
# DESCRIPTION
require 'active_support/core_ext/module/delegation'
module Locking
def lock(*whitelist, &block)
Class.new(lockable) { delegate(*whitelist, to: :context) }
.new(self).instance_eval(&block)
end
private
LSI - Latent Semantic Indexing
Look at occurrences of words in a corpus of documents, index them by repetition of words, then generate a matrix of "physical closeness" between words which
approximates semantic closeness remarkably well. Want to remove stop words from documents to avoid false positives.
Would stemming help LSI?
LSI is slow, because it analyzes entire bodies of text.
Full Text Search
Removes stop words
Stems words
Can be indexed in Postgres, which is fast.