Skip to content

Instantly share code, notes, and snippets.

View aghyad's full-sized avatar
🤖
Never give up

Aghyad Saleh aghyad

🤖
Never give up
View GitHub Profile
@aghyad
aghyad / Keybase.md
Created July 9, 2019 02:39
Keybase.md

Keybase proof

I hereby claim:

  • I am aghyad on github.
  • I am aghyad (https://keybase.io/aghyad) on keybase.
  • I have a public key ASAuvxwdUY3Su8rEXMVfGJKmkTO4NzSkICq5lAqzG4Jz3Qo

To claim this, I am signing this object:

@aghyad
aghyad / it-doesn't-have-to-be-crazy-at-work.md
Created December 19, 2018 20:33
Some of my favorite quotes from "It Doesn't Have To Be Crazy At Work" by Jason Fried and David Heinemeier Hansson

Any mistakes are my own. Basecamp is a modern software company that (by many estimates) generates millions of dollars in profit each month.

Promise not to promise

Since the beginning of Basecamp, we've been loath to make promises about future product improvements. We've always wanted customers to judge the product they could buy and use today, not some imaginary version that might exist in the future.

The wrong time for real-time

Chat puts conversations on conveyor belts that are perpetually moving away from you. If you're not at your station when the conversation rolls by, you'll never get a chance to put in your two cents. This means if you want to have your say, you need to be paying attention all day (and often to multiple rooms/channels). ... Chat is great for hashing stuff our quickly when speed truly is important. ... It's also great for watercooler-like banter ... building a camaraderie among people during gaps in the workday.

@aghyad
aghyad / macros.md
Created July 11, 2018 21:21 — forked from jessejanderson/macros.md
Don't Write Macros (but do learn how they work)
@aghyad
aghyad / installing_passenger_nginx_ror_on_ubuntu_without_rvm_rbenv
Last active March 19, 2018 10:42
A quick tutorial on installing passenger, Nginx, Ruby and Rails on Ubuntu 12.04 (without RVM/without rbenv)
When installing passenger, Nginx, Ruby and Rails on Ubuntu 12.04 (without RVM/without rbenv):
First: installing Ruby (without RVM):
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev \
rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
@aghyad
aghyad / haml_crash_course.txt
Last active December 28, 2016 08:54
Crash course in HAML
- is used where you would normally use <%
= is used where you would normally use <%=
% A percentage sign is HTML tags. Like: %h1 , %ul , %li
# A hash is the name of an id of a div tag. For example, #comment is for id="comment"
. A period is for the name of a class of a div tag. For example, .comment is for the class="comment"
@aghyad
aghyad / gdb_ruby_backtrace.py
Created June 20, 2016 16:21 — forked from csfrancis/gdb_ruby_backtrace.py
Dump an MRI call stack from gdb
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
def get_lineno(iseq, pos):
@aghyad
aghyad / chef_solo_bootstrap_ubuntu.sh
Last active January 3, 2016 07:09 — forked from ryanb/chef_solo_bootstrap.sh
chef_solo_bootstrap.sh for Ubuntu <forked from RyanB's Ubuntu>
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@aghyad
aghyad / chef_solo_bootstrap_centos.sh
Last active January 3, 2016 07:09 — forked from ryanb/chef_solo_bootstrap.sh
chef_solo_bootstrap.sh for Centos 6.5 <forked from RyanB's Ubuntu>
#!/usr/bin/env bash
sudo yum -y update && sudo yum -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev libyaml wget rubygems
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
sudo make
sudo make install
gem install chef ruby-shadow --no-ri --no-rdoc
@aghyad
aghyad / testing_rake_tasks.txt
Created December 20, 2013 17:32
My take on testing rake tasks
So you like to write some complicated tests plugged into your rake tasks. Or may be you think you're doing a crime not doing so. I understand. Nothing is wrong with that. But it's more like buying a helicopter so you can travel two blocks in Manhattan.
I'll explain:
1 - Rake tasks are not meant to be a complicated piece of your website. Instead, rake tasks are meant to be "thin" and only to invoke other modules in your system. Those modules do the heavy work. Those modules are what really matters. So, test the meaningful code and not the code that invokes it. Well, if you are still feeling unconfident about the invoking processes ... then:
2 - Trust rails and trust the whole framework. Don't bother testing whether this rake task is going to print something minor. It will work. Otherwise, you have a bigger issue that missing tests in the framework.
In summary: Focus your energy more on testing the functionality that this rake task is written to invoke, which is a class or a method some where else in your