Skip to content

Instantly share code, notes, and snippets.

View lucasmartins's full-sized avatar
🤘

Lucas Neves Martins lucasmartins

🤘
View GitHub Profile
@rantav
rantav / README.md
Created August 23, 2012 06:13
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@oestrich
oestrich / Gemfile
Created September 5, 2012 15:37
WebMachine Test
source :rubygems
gem 'webmachine'
gem 'rspec'
gem 'rspec_api_documentation'
gem 'rack-test'
gem 'json_spec'
@fellix
fellix / gist:3643749
Created September 5, 2012 20:07
Receita de pao de queijo
3 ovos
3 xícaras de polvilho (preferencia azedo, mas pode usar o doce também)
1 xícara de azeite
100g de queijo (qualquer um)
sal a gosto.
bata no liquidificador tudo, despeje em formas de empadinha coloque assar no forno, espere dourar, e pronto.
@masonforest
masonforest / gist:4048732
Created November 9, 2012 22:28
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@antonio
antonio / fix_asset_not_precompiled_error.rb
Created November 19, 2012 16:14
Avoid Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError
# This file monkey patches the Rails include helpers to prevent them from
# failing with an AssetNotPrecompiled error. This should be fixed in
# Rails 4.x and by then we should delete this file
module Sprockets
module Helpers
module RailsHelper
alias_method :original_stylesheet_link_tag, :stylesheet_link_tag
alias_method :original_javascript_include_tag, :javascript_include_tag
alias_method :original_image_path, :image_path
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 13, 2024 07:02
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@wolfeidau
wolfeidau / ruby2dtrace.md
Last active December 14, 2015 02:09
How to install ruby-2.0.0-p0 into rbenv with dtrace support

The aim of this post is to guide the reader through the process of installing ruby 2.0.0 into rbenv with dtrace probes enabled. As rbenv uses ruby-build, which currently downloads and compiles a copy of openssl rather than using the one maintained and updated in homebrew i prefer to use the homebrew one.

Note that you MUST install xcode before installing anything, then install homebrew, and lastly install openssl, via homebrew as follows.

brew install openssl

Next to overcome the fact that OSX doesn't have an openssl ca certificate bundle, use the following brew to create and maintain one using the CA certs stored in your keychain.

@bradhe
bradhe / heroku_rell_test.sh
Last active December 15, 2015 19:49
Results of ab against ruby 2.0 + reel + Heroku #disappointed
brad@/www/reel_test [master] $ heroku scale web=40
Scaling web processes... done, now running 40
brad@/www/reel_test [master] $ ab -c 1 -n 100 http://reel-test.herokuapp.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking reel-test.herokuapp.com (be patient).....done
@petehamilton
petehamilton / README.md
Last active March 31, 2020 18:18
Circle CI Build Status widget for Dashing (Multiple Builds)

Description

Dashing widget to show the status of builds from CircleCI. Also shows the avatar of the person who is running/breaking/passing the current build.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@petehamilton
petehamilton / README.md
Last active July 8, 2021 09:50
Circle CI Build Status widget for Dashing (Single Builds)

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then: