Skip to content

Instantly share code, notes, and snippets.

View matflores's full-sized avatar

Matías Flores matflores

View GitHub Profile
@matflores
matflores / engineering.md
Last active August 29, 2015 14:16
Engineering Tasks

Engineering: Redesign Elasticsearch/Redis health checks to improve performance of all M2X requests

Engineering: Design & Implement robust & reliable messaging solution between data centers using RabbitMQ

Engineering: Redesign workers messaging and queuing (possibly migrating them from Ost-based queues to RabbitMQ queues)

Engineering: Unify datapoint writer and trigger evaluator queues (avoid queueing each datapoint twice).

Engineering: Optimize datapoint writer worker

@matflores
matflores / pretty_json.rb
Created November 1, 2013 19:28
Rack middleware for returning pretty JSON when `pretty` parameter is present and it's not `"false"`.
module Rack
# Prettify JSON responses on demand.
#
#
#
# Builder Usage:
# use Rack::PrettyJSON
#
class PrettyJSON
#!/usr/bin/env ruby
# Script to create a jekyll blog post using a template. It takes one input parameter
# which is the title of the blog post
# e.g. command:
# $ ./new.rb "helper script to create new posts using jekyll"
#
# Author:Khaja Minhajuddin (http://minhajuddin.com)
# Some constants
@matflores
matflores / new_gist_file
Created May 30, 2013 18:23
jsPerf aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks. http://jsperf.com/
_
@matflores
matflores / gist:3692524
Created September 10, 2012 17:53
Fixing conflicts between Ghostscript & gs

Fixing conflicts between Ghostscript & gs

If you are using gs for managing your gem sets and you are also using any tool that relies on Ghostscript for converting PDF files to other formats (e.g. GraphicsMagick, docsplit, etc.), you may find that one of the two will fail due to a conflict between the two gs commands.

There are two possible solutions to this problem:

  • rename the gs command to something else (e.g. gset, gs_, etc), and leave Ghostscript's gs as the only gs command in your system.
  • edit GraphicMagick's delegates file and specify the full path to the gs command. This file is located in the lib/GraphicsMagick/config directory of your GraphicsMagick's installation. If GraphicsMagick was installed via homebrew, you can find the full path to this file by running brew list graphicsmagick | grep delegates.
Testing gist mode for Emacs
Hello Erin,
The only issue we have at the moment with the server is that we need to install some tools on it and it doesn't seem capable of resolving urls.
Specifically, we are trying to install s3fs (http://code.google.com/p/s3fs/). Homebrew is already installed on that server and we used it successfully in the past for installing other libraries we needed, so the easiest way of installing s3fs is:
brew install s3fs
Which will attempt to install s3fs and all its dependencies. At this point the installation will fail because ftp.gnu.org cannot be resolved (neither its mirrors can).
@matflores
matflores / gist:1388602
Created November 23, 2011 12:56
SR Performance ToDo
- Extract FiltersManager and other filter-related modules from filters.js
- Extract search modules from search.js
- Extract modules from sidebar.js
- Define the three main interfaces (visitor, user & admin)
- Define specific routers in visitor, user & admin (and then remove app/routes.js)
- Extract common routes from visitor.js and user.js (about, contact, etc)
- Define main.js module (will be required by the three main modules)
- Require helpers.js from main.js and extend the main sr object
- Move initialization code from app.js and common.js to main.js
- Define a config.js module that will be generated dynamically (contains the SHA, the timestamp and it's the only non-cacheable module, which will be responsible of expiring the rest)
defaults: &defaults
adapter: sqlite3
timeout: 5000
development:
<<: *defaults
database: db/development.sqlite3
test:
<<: *defaults
From b89f9514facc348091074ca360e57a5ef9ab94e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C3=ADas=20Flores?= <mflores@atlanware.com>
Date: Thu, 7 Apr 2011 14:36:16 -0300
Subject: [PATCH 1/2] Add missing semi-colons
---
ui.watermark.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui.watermark.js b/ui.watermark.js