Skip to content

Instantly share code, notes, and snippets.

View embasbm's full-sized avatar

Emba Moussa embasbm

View GitHub Profile
@embasbm
embasbm / lessons-sources
Created August 7, 2017 10:42
EI lessons:
http://guides.rubyonrails.org/caching_with_rails.html#fragment-caching
@embasbm
embasbm / tmux-cheatsheet.markdown
Created July 19, 2017 08:35 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@embasbm
embasbm / capybara cheat sheet
Created June 22, 2017 13:33 — forked from zhengjia/capybara cheat sheet
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')
@embasbm
embasbm / console testing
Created May 16, 2017 16:30
EI DataLayerEpic
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 October 27, 2016 20:55 — forked from tomysmile/memcached_macosx.md
Installing memcached on Mac with Homebrew and Lunchy

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 April 25, 2016 09:38
Catch up 25-04-2016
- 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 March 31, 2016 15:18
sidekiq not showing "INFO: Starting processing" when using capistrano-sidekiq
...
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 July 28, 2020 13:34
docker-compose failing example
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
natural_numbers = Enumerator.new do |yielder|
number = 1
loop do
yielder.yield number
number += 1
end
end
@embasbm
embasbm / my_enumerator.rb
Last active September 3, 2015 14:31
Inheritance in rUBY
class MyEnumerator < Enumerator
def initialize(*)
super() do |yielder|
end
end
end