Skip to content

Instantly share code, notes, and snippets.

View jimarnold's full-sized avatar

Jim Arnold jimarnold

View GitHub Profile
@jimarnold
jimarnold / gist:3657634
Created September 6, 2012 15:47
reverse truncate a file
Reverse-truncate a file, leaving the last 100 lines intact:
sed -i '' '1,100d' FILENAME
or with backups:
sed -i .bak '1,100d' FILENAME
@jimarnold
jimarnold / adventures_in_go.md
Created November 5, 2012 22:35
Adventures in Go

Executive summary

Go is C with type-safety and garbage collection, and Java without all the Java. It does a fairly good job of getting out of your way, but it is, to me, a language of compromises. It is strongly, statically typed but lacks generics. It has useful built-in types but they act very differently to the types you can create for yourself. It wants to be a modern language but uses 40 year old syntax. The core library is a confusing mix of functions-that-act-on-values and methods-on-types.

That said, I have enjoyed using it. It's compiled, but there is very little compiler wrangling due to the way your source files must be structured, and external dependencies are resolved from source, not from linker arguments. It's fast. It feels familiar. The concurrency and functional aspects are great. Would I recommend it to a client? Not yet - Java and C# are far more mature and Go doesn't offer anything compelling for the types of programs you might use those languages for (it has been said of Go that it

diff --git a/deployment/thoroughbred/namespaces/development/services/mott-ui/deployment.yaml b/deployment/thoroughbred/namespaces/development/services/mott-ui/deployment.yaml
index aa50c35..627c344 100644
--- a/deployment/thoroughbred/namespaces/development/services/mott-ui/deployment.yaml
+++ b/deployment/thoroughbred/namespaces/development/services/mott-ui/deployment.yaml
@@ -20,7 +20,7 @@ application:
application_config:
containers:
- name: mott-ui
- image_uri: gcr.io/etsy-kb-ci-prod/mott-ui@sha256:4b3f3e6496cdb7a370e66aaa777e0f38b8b38affb571f1dc667e8ec9845392e3
+ image_uri: gcr.io/etsy-kb-ci-prod/mott-ui@sha256:135dee2da4b23b4780e596d42f31bf03fef1a734e4ec5b885b7af03e6af6a292
diff --git a/bin/dist-all b/bin/dist-all
index 563216a8f..ddbd89206 100755
--- a/bin/dist-all
+++ b/bin/dist-all
@@ -148,7 +148,8 @@ distTranslationsToSearch() {
local gitHash=$2
# MOTT-translated languages
- local langs=(de en en-GB es fr it ja nl pl pt ru)
+ # TODO: remove 'en' when downstream systems support 'en-US'
diff --git a/phplib/Generated/MOTT/ecad190/AttributeValuesMessageCatalog.php b/phplib/Generated/MOTT/ecad190/AttributeValuesMessageCatalog.php
index 71dbffed5cbb..51ce0b10c196 100644
--- a/phplib/Generated/MOTT/ecad190/AttributeValuesMessageCatalog.php
+++ b/phplib/Generated/MOTT/ecad190/AttributeValuesMessageCatalog.php
@@ -179,7 +179,7 @@ class Generated_MOTT_ecad190_AttributeValuesMessageCatalog {
"163" => ["content" => "Linoleum","desc" => "A possible value for the listing attribute(s): General material, Materials, Art medium","proj" => "Search2","feature" => "Search2_OTT_Attributes"],
"164" => ["content" => "Llama","desc" => "A possible value for the listing attribute(s): Primary fiber, Fiber, Secondary fiber, General material, Materials","proj" => "Search2","feature" => "Search2_OTT_Attributes"],
"165" => ["content" => "Lurex","desc" => "A possible value for the listing attribute(s): Primary fiber, Fiber, Secondary fiber, General material, Materials","proj" => "Search2","featu
commit e81637d95a02696a85ccefcf3a16e83890a38817
Author: Jim Arnold <mrjimarnold@gmail.com>
Date: Wed Jun 23 14:18:17 2021 -0400
remove rogue backticks
diff --git a/src/data/AttributeValueSet.js b/src/data/AttributeValueSet.js
index 153cfefc6..f525a1165 100644
--- a/src/data/AttributeValueSet.js
+++ b/src/data/AttributeValueSet.js
diff --git a/src/views/search/SearchForm.js b/src/views/search/SearchForm.js
index 112b5dde9..bbbaf68ad 100644
--- a/src/views/search/SearchForm.js
+++ b/src/views/search/SearchForm.js
@@ -80,7 +80,7 @@ export class SearchForm extends Component {
: [];
}
- if (!this.props.includeMigrated && this.props.taxonomy !== null) {
+ if (this.props.pageType === 'taxonomy' && !this.props.includeMigrated && this.props.taxonomy !== null) {
commit e8492c0f5c80762ababf1e80148b23307bc2a2d6
Author: Jim Arnold <jarnold@etsy.com>
Date: Wed Dec 15 13:26:05 2021 -0500
[TI-226] fix for adding a migration with a hand-typed attribute value id
diff --git a/src/views/selection/MigrationSelection.js b/src/views/selection/MigrationSelection.js
index 0b95e8a60..1065e61d3 100644
--- a/src/views/selection/MigrationSelection.js
+++ b/src/views/selection/MigrationSelection.js
diff --git a/src/main/scala/com/etsy/kb/service/common/model/ott/TaxonomyNode.scala b/src/main/scala/com/etsy/kb/service/common/model/ott/TaxonomyNode.scala
index b31bdb0a..3df413cb 100644
--- a/src/main/scala/com/etsy/kb/service/common/model/ott/TaxonomyNode.scala
+++ b/src/main/scala/com/etsy/kb/service/common/model/ott/TaxonomyNode.scala
@@ -51,9 +51,9 @@ object TaxonomyNode {
* @return whether or not the node is visible
*/
def isVisible(node: TaxonomyNode): Boolean = {
- // Nodes are always visible unless they have a seller_node_visibility field AND
- // it does not contain the value "VISIBLE". I don't make the rules.
diff --git a/phplib/Atlas/Recsys/BuyerHub/ApiSpecs/Index.php b/phplib/Atlas/Recsys/BuyerHub/ApiSpecs/Index.php
index 840b5d2b7c76..29e4405f3286 100644
--- a/phplib/Atlas/Recsys/BuyerHub/ApiSpecs/Index.php
+++ b/phplib/Atlas/Recsys/BuyerHub/ApiSpecs/Index.php
@@ -4,13 +4,18 @@
class Atlas_Recsys_BuyerHub_ApiSpecs_Index implements Neu_Api_Spec_IHash {
use Neu_Api_Spec_Hash;
const REF_TAG = 'buyer_hub_ref_tag';
+ /**
+ * @var array