Skip to content

Instantly share code, notes, and snippets.

Emba Moussa embasbm

Block or report user

Report or block embasbm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ruby-on-rails-engineer-solved.rb
require 'faker'
#================#
# Question 1 #
#================#
=begin
Intor:
View lessons-sources
http://guides.rubyonrails.org/caching_with_rails.html#fragment-caching
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View console testing
B: JSON.stringify(dataLayer.find(x => x['event'] === 'eeProductDetail'), null, 20)
C: JSON.stringify(dataLayer.find(x => x['eventAction'] === 'displayForm'), null, 20)
A: JSON.stringify(dataLayer.find(x => x['event'] === 'addToCart'), null, 20)
D: JSON.stringify(dataLayer.find(x => x['eventAction'] === 'sentForm'), null, 20)
@embasbm
embasbm / memcached_macosx.md
Created Oct 27, 2016 — forked from tomysmile/memcached_macosx.md
Installing memcached on Mac with Homebrew and Lunchy
View memcached_macosx.md

Installing memcached on Mac with Homebrew and Lunchy

This is a quick guide for installing memcached on a Mac with Homebrew, and starting and stopping it with Lunchy. I hope this tutorial will get your memcached up and running in no time.

Step 1 — Install Homebrew

Installing Homebrew is super easy. Just paste this in your terminal —

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@embasbm
embasbm / catch up
Created Apr 25, 2016
Catch up 25-04-2016
View catch up
- build with only one item returned.
* auto link:
1 - link user with the offer they give back when user is just beeing created. (in this worked we dont care if the user has a card)
2 - (other worker) link all users with all offers (no matter when both are created) (user must have attached card)
* retailers:
1 - when retailers is created, check all his offers and link them to all our current users
@embasbm
embasbm / Gemfile.lock
Created Mar 31, 2016
sidekiq not showing "INFO: Starting processing" when using capistrano-sidekiq
View Gemfile.lock
...
capistrano-sidekiq (0.5.4)
capistrano
sidekiq (>= 3.4)
...
sidekiq (4.1.1)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
...
@embasbm
embasbm / Dockerfile
Last active Feb 12, 2016
docker-compose failing example
View Dockerfile
FROM ruby:2.2.0
RUN apt-get update -qq && apt-get install -y build-essential
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
ADD Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
ADD . /myapp
EXPOSE 3000
View lazy_iterator.rb
natural_numbers = Enumerator.new do |yielder|
number = 1
loop do
yielder.yield number
number += 1
end
end
You can’t perform that action at this time.