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 / 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 / genmac.rb
Last active August 29, 2015 14:22 — forked from cyberkov/genmac.rb
#!/usr/bin/env ruby
#require 'rubygems'
#require 'pry'
#require 'pp'
# This scripts returns a list of MAC addresses.
# Usage:
# ./$0 LIMIT START END
# ./genmac.rb 5 00:50:56:00:00:00 00:50:56:3F:FF:FF
#
@aghyad
aghyad / core_exts.rb
Last active August 29, 2015 14:11 — forked from shell/core_exts.rb
## Like a Symbol#to_proc but for array
class Array
def to_proc
lambda {|object|
self.map{|symbol| object.send(symbol.to_sym)}
}
end
end
@aghyad
aghyad / and_or_in_stmts_in_ruby
Last active August 29, 2015 14:11
"&&" and "||" in ruby statements (not if-stmts)
"&&" and "||" in ruby statements (not if-stmts):
stmt1 && stmt2
returns the first falsey result, or if no falsey's found, returns the last truthy result
ex:
'hello' && 'bye'
=> 'bye'
'hello' && false
=> false
false && 'hello'

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8