Skip to content

Instantly share code, notes, and snippets.

View marcusvmsa's full-sized avatar
🎯
Focusing

Marcus Sá marcusvmsa

🎯
Focusing
  • Vakinha
  • Porto Alegre - Brazil
View GitHub Profile
@marcusvmsa
marcusvmsa / bulk_gems.rb
Created March 7, 2012 13:49
Instalando várias GEMS de forma automátizada
#Primeiro eu jogo as gems do servidor em um arquivo .txt qualquer
gem list > my_gems.txt
#Esse é o script que vai instalar as gems
bulk_gems.rb
#! /usr/local/bin/ruby
STDIN.readlines.each do |l|
m = l.match /^(\S+) \((.*)\)/
unless m.nil?
~$ free -m
total used free shared buffers cached
Mem: 497 441 56 0 1 156
-/+ buffers/cache: 282 214
Swap: 255 131 124
~$ ps -eo pmem,pcpu,rss,vsize,args --sort -pmem | less
%MEM %CPU RSS VSZ COMMAND
9.2 0.0 47056 112108 Rack: /srv/www/oclube.co
@marcusvmsa
marcusvmsa / gist:3527142
Created August 30, 2012 11:58
Como instalei o Imagemagick no mountain lion
brew uninstall imagemagick; brew install imagemagick --build-from-source; brew install libpng; brew link libpng
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@marcusvmsa
marcusvmsa / diff.js
Created February 8, 2018 13:00
Deep diff between two object, using lodash/fp
// https://gist.github.com/Yimiprod/7ee176597fef230d1451#gistcomment-2324809
const transform = _.transform.convert({
cap: false,
});
const iteratee = baseObj => (result, value, key) => {
if (!_.isEqual(value, baseObj[key])) {
const valIsObj = _.isObject(value) && _.isObject(baseObj[key]);
result[key] = valIsObj === true ? differenceObject(value, baseObj[key]) : value;