Skip to content

Instantly share code, notes, and snippets.

View emaraschio's full-sized avatar
🏠
☕ 🤓

Ezequiel Maraschio emaraschio

🏠
☕ 🤓
View GitHub Profile
● Comandos Para Jugar Como YO:
cl_updaterate "100"
cl_cmdrate "105"
cl_cmdbackup "2"
rate 1000000
ex_interp "0.01"
cl_shadows "0"
gl_fog "1"
cl_weather "0"
import ApolloClient, { FetchPolicy } from "apollo-client"
import { HttpLink } from "apollo-link-http"
import { InMemoryCache, NormalizedCacheObject } from "apollo-cache-inmemory"
// import { setContext } from "apollo-link-context"
import ActionCable from "action-cable-react-jwt"
import ActionCableLink from "graphql-ruby-client/dist/subscriptions/ActionCableLink"
import { ApolloLink } from "apollo-link"
import { handleAuthentication, refreshToken } from "utils/oauth"
import { Observable } from "apollo-link"
import { onError } from "apollo-link-error"
@emaraschio
emaraschio / get_title.rb
Created March 22, 2018 19:45
get_title.rb
require 'open-uri'
p = Nokogiri::HTML(open('http://vue-js-modal.yev.io/'))
puts p.title
@emaraschio
emaraschio / Tmux - Basic Usage
Last active August 29, 2015 14:21
My Notes about Tmux
0- Install in OS X
brew install tmux
1- Add this line on your shell client
tmux attach -t yoursession || tmux new -s yoursession
2- Windows
CTRL+B % -> Split
CTRL+B " -> Move to other panel
CTRL+B <UP ARROW> -> Move to next panel
@emaraschio
emaraschio / order_array.rb
Created April 15, 2015 23:09
Array sort with Ruby
def new_sort(left_sorted, right_sorted)
ordered_array = []
left = 0
right = 0
loop do
break if right >= right_sorted.length and left >= left_sorted.length
if right >= right_sorted.length or (left < left_sorted.length and left_sorted[left] < right_sorted[right])
ordered_array << left_sorted[left]
@emaraschio
emaraschio / cache_query.rb
Last active August 29, 2015 14:14
Cache Rails Query
@results = Rails.cache.fetch "your_cache_key", :expires_in => 1.days do
#Do the query
end
@emaraschio
emaraschio / player.rb
Last active June 1, 2017 20:52
Ruby Warrior Game
class Player
def play_turn(warrior)
@warrior = warrior
@health ||= warrior.health
@direction ||= :forward
warrior_feel = @warrior.feel @direction
if enemy_ahead?
@warrior.shoot!
elsif warrior_feel.empty?
@emaraschio
emaraschio / SOLID.markdown
Last active May 24, 2023 07:18
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

@emaraschio
emaraschio / jsconfar_2014.markdown
Last active April 30, 2017 17:10
My notes about JS Conf Arg 2014