Skip to content

Instantly share code, notes, and snippets.

View edelbalso's full-sized avatar

Eduardo Del Balso edelbalso

  • LendingHome
  • San Francisco
View GitHub Profile
require 'myclass'
traceable = MyClass.CreateTraceableObject()
@edelbalso
edelbalso / performance_metrics.md
Created July 9, 2012 23:41 — forked from uhhuhyeah/performance_metrics.md
Concepts used in browser-side performance testing

An Important Note

These are the metrics that would be used by the engineering team to evaluate effectiveness of front-end optimizations, and shouldn’t be communicated to stakeholders. Emily’s 90% page loaded metric is a way better model for measurable progress of “page load time”.

Outline

The purpose of this document is to outline the main metrics we use when discussing various end-user performance measurements such as "page speed".

Fig 1) A diagram we have been using in conversations to help illustrate the various events and how they inter-relate.

#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@edelbalso
edelbalso / Notes.md
Created December 18, 2012 18:36 — forked from bosoxbill/Notes.md

Setup RVM/Rails

With RVM installed, I like to maintain a gemset called new_projects. This has whatever rails version I want to be creating new projects with.

$ rvm 1.9.3@new_projects --verbose --create
$ gem install rails

Rails Setup Commands

@edelbalso
edelbalso / widget.js
Last active December 11, 2015 23:28 — forked from uhhuhyeah/widget.js
window.utils = window.utils || {};
utils.Grid = function() {
 // Defaults
 var that = this;
 this.idealColumnWidth = 320;
 this.marginHoriz = 15;
   
 // Public Interface
 var setupGrid = function(opts) {
require 'faraday_middleware'
require 'hashie/mash'
# Public: GeoIP service using freegeoip.net
#
# See https://github.com/fiorix/freegeoip#readme
#
# Examples
#
# res = GeoipService.new.call '173.194.64.19'
require 'faraday_middleware'
require 'hashie/mash'
# Public: GeoIP service using freegeoip.net
#
# See https://github.com/fiorix/freegeoip#readme
#
# Examples
#
# res = GeoipService.new.call '173.194.64.19'
run ->(e){ p=Hash[*e['QUERY_STRING'].split(/[&=]/)]; [200, {'Content-type'=>'text/html'}, ["Hello #{p['name']}!"]] }
# Outputs this at warn log level:
# 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]}
#
# Save as config/initializers/oneline_detailed_logging.rb. Consider
# decreasing the log level from "info" to "warn" (in production.rb) so
# the one-line log message replaces the standard request logs.
# override process_action to add 2 things to the payload:
# - remote IP