Skip to content

Instantly share code, notes, and snippets.

View mzikherman's full-sized avatar

Matt Zikherman mzikherman

View GitHub Profile
@mzikherman
mzikherman / partial_render_rollout.md
Created September 23, 2019 20:26
Rollout of partial renders

This is the PR that turns off the blanket 500s for any response.errors present in an MP response, in favor of only serving an error page for a 'principal field' error: artsy/reaction#2836

We discussed in planning getting this on staging

@mzikherman
mzikherman / facets.rb
Created February 15, 2016 21:37
ES faceted working
{
"fields" : ["id"],
"query" : { "match_all" : {} },
"filter" : {
"bool" : {
"must" : [{"term" : {"colors" : "red" } }, {"term" : {"published" : true} }, {"and" : [{"term" : {"genes" : "Installation"}}]}]
}
},
"aggregations" : {
"medium" : {
{
"application_id": "6QjcrwQ2_U0a3hsYwXLogLQ",
"src": "https://s3.amazonaws.com/mzikherman-blitline-test/images/skull.jpg",
"functions": [
{
"name": "script",
"params": {
"files": "https://s3.amazonaws.com/mzikherman-blitline-test/scripts/slice_and_upload.sh,https://s3.amazonaws.com/mzikherman-blitline-test/scripts/upload_to_s3.rb",
"executeable": "./slice_and_upload.sh input.png"
},
@mzikherman
mzikherman / gist:9610125
Created March 17, 2014 22:59
Group Artworks into columns for a pinterest style layout (for use in emails)
module ArtworkColumns
# Return an array of artworks grouped together in sub arrays by being added to the shortest 'column'
# based on a fixed width and aspect ratios.
#
# @param {Array} artworks The array of artworks to group into columns
# @param {Number} num_columns The number of columns to group them into
# @param {Number} width The width the images will be displayed at
#
# @return {Array} An array of artworks grouped into sub arrays by being added to the shortest one.
def self.artwork_columns(artworks, num_columns, width)
@mzikherman
mzikherman / Collection.coffee
Created February 1, 2013 00:35
Attempt at making a generic config for any collection
generateStandardCSVConfiguration: ->
retConfig = []
for fldName, fldValue of @models[0].attributes
retConfig.push [ fldName, (o) -> o.get("#{fldName}") ]
retConfig