Skip to content

Instantly share code, notes, and snippets.

View daviscabral's full-sized avatar

Davis Z. Cabral daviscabral

View GitHub Profile
@johnwylie70
johnwylie70 / WorkbookReactNative5.md
Created March 6, 2019 09:59
Getting Workbook running with React Native

Use Storybook version 4.1.13 as 5 is not ready for React Native

Tested: 6th March 2019

Install mac homebrew:

Download rom here: https://brew.sh/ `

Setup brew

@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 11, 2024 07:57
OS X Screencast to animated GIF

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:

@rubiii
rubiii / monkey_path.rb
Created January 29, 2012 12:41
Monkey patch Savon to allow attributes to be added to the SOAP header tag
require "savon"
module Savon
module SOAP
class XML
attr_accessor :header_attributes
def to_xml
@xml ||= tag(builder, :Envelope, complete_namespaces) do |xml|
@sstephenson
sstephenson / gist:1143900
Created August 13, 2011 14:20
Using multiple versions of Rails without gemsets
# RubyGems has this functionality built-in. Just specify
# the particular version you want to use as the first argument
# of the command, surrounded by underscores.
$ gem install rails --version 3.0.9
...
$ gem install rails --pre
...
$ rbenv rehash
$ rails --version
var net = require('net');
var connectTimes = [];
function connect() {
var socket = new net.Socket({type: 'tcp4'});
var time = Date.now();
socket.setTimeout(30000);
//socket.connect(5015, '66.228.62.138');
socket.connect(5012, 'fragola.sfarm1.com');
@tomash
tomash / pulp_rate.rb
Created April 27, 2011 09:28
Spree shipping cost calculator
class Calculator::PulpRate < Calculator
preference :category1_rate, :decimal, :default => 0
preference :category2_rate, :decimal, :default => 0
preference :category3_rate, :decimal, :default => 0
preference :category4_rate, :decimal, :default => 0
preference :category5_rate, :decimal, :default => 0
WEIGHT_RANGES = {
0..350 => :preferred_category1_rate,
351..500 => :preferred_category2_rate,
#!/usr/bin/env ruby
HELP = <<EOS
Freshbridge helps you to create an invoice with items from a Pivotal Tracker Project.
Just to avoid mess your stuff - this script don't create invoices - just update an existent invoice.
DEPENDENCIES:
- freshbooks
- HTTParty
EOS