Skip to content

Instantly share code, notes, and snippets.

View rafaelsales's full-sized avatar
💻
Compiling...

Rafael Sales rafaelsales

💻
Compiling...
View GitHub Profile
@bespokoid
bespokoid / SpaceVim.md
Last active July 17, 2024 07:37
SpaceVim cheatsheet #tools
@rafaelsales
rafaelsales / ruby-bug.rb
Created November 29, 2018 23:13
Ruby bug with keyword arguments in the initializer being used via method(:new)
hash = {
1 => { c: 2 },
2 => { c: 4 },
}
class Works
def do(a, c:)
puts "a: #{a.inspect}; c: #{c.inspect}"
end
end

GraphQL vs Firebase

With the variety of server-side technologies today, developers have a lot of choices when it comes to deciding what kind of backend to use for their next application.

In this article, we want to explore the differences between GraphQL and Firebase, two very popular server-side technologies.

Overview

Before diving into technical details, let's create some perspective on the two technologies and where they're coming from.

@wojteklu
wojteklu / clean_code.md
Last active July 23, 2024 07:14
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@cmilfont
cmilfont / Elon.md
Last active December 25, 2018 14:24
Elon Musk

1: Name the enemy

2: Answer “Why now?”

3: Show the promised land before explaining how you’ll get there

4: Identify obstacles—then explain how you’ll overcome them

5: Present evidence that you’re not just blowing hot air

@mperham
mperham / locktest.rb
Created April 23, 2016 20:04
Distributed Locking with Redis and Ruby
require 'benchmark'
require 'sidekiq-ent'
require 'redis-lock'
require 'redis-semaphore'
require 'ruby_redis_lock'
# monkey patch to remove exponential backoff in pmckee11-redis-lock,
# otherwise this benchmark does not complete successfully.
class Redis
class Lock
@igorsantos07
igorsantos07 / 1 General info.md
Last active April 22, 2016 17:48
CSS tools on React

Main comparison

  1. Traditional CSS

  • Simple approach, known API
  • we would have to deal with namespace conflicts
  • leverages browser caching, storing the entire app style in the first load and reducing following reloads
  1. Style-based implementations

Tuple Labs Software Vendor Models

Foreword

These are the models of software vendors we use as a starting point for defining sales strategies at Tuple Labs in Austin, Texas. We think of classes of companies in the space differently so that we can best fit our proposals to deliver high ROI and follow our client company business models. You may use this work as long as you comply with the license terms.

It should be noted that many service providers and companies fall into multiple categories, and that the lines are not as clean as defined herein. At larger companies, one often sees different strategic business units operating under entirely different paradigms. Many offerings have features that blur the distinction between these models - these are simple guideline business models.

Finally, this document not meant to be a highly scientific treatment of the different kinds of software businesses. It is meant to be an approachable introduct

@tkrajcar
tkrajcar / newrelic-metaprogramming-challenge.md
Created November 21, 2014 18:56
New Relic Ruby Metaprogramming Challenge

Your challenge, should you accept it, is to write a Ruby library that will modify an existing program to output the number of times a specific method is called.

You solution library should be required at the top of the host program, or via ruby's -r flag (i.e. ruby -r ./solution.rb host_program.rb).

Your solution library should read the environment variable COUNT_CALLS_TO to determine the method it should count. Valid method signatures are Array#map!, ActiveRecord::Base#find, Base64.encode64, etc.

Your solution library should count calls to that method, and print the method signature and the number of times it was called when the program exits.

Also, your solution should have a minimal impact on the program's running time. set_trace_func is a no-go...

@denzildoyle
denzildoyle / SEO.md
Last active July 11, 2024 22:54
I short list of SEO tips and tricks I have learned over time

SEO

In this list, I will be typically be talking SEO as it relates to Google because Google will likely account for the vast majority of your inbound search traffic. Additionally, if you rank highly on Google, you will probably do well on other search engines anyway. Just like in football if you could play in the Major league you would most likely kill it in the minor league I would begin by explaining why SEO is important talk a little bit about what SEO is about and talk about how those concepts relate to the world wide web. Then talk about some of the things you could do to optimize your site from top to bottom of a typical webpage.

Why it's important

  • When you want to hide something on google put it on the second page. #SEO @searchdecoder
  • Winner takes almost everything
  • More than 80 percent of shoppers research big purchases online first
  • Opertunity for business
  • 88% Of Consumers Trust Online Reviews As Much As Personal Recommendations
  • 72% Of Consumers Say That Positive Reviews Make Them T