Skip to content

Instantly share code, notes, and snippets.

View ahyield's full-sized avatar
🛠️
Catching some ⛅️⛅️

Ahmed ahyield

🛠️
Catching some ⛅️⛅️
View GitHub Profile
@ahyield
ahyield / crackle_pop.rb
Created June 3, 2016 23:27
Code CracklePop
module Divisable
def divided_by?(num, divisor)
num % divisor == 0
end
end
class CracklePop
include Divisable
def initialize
@ahyield
ahyield / tweet-selenium.rb
Last active March 21, 2016 03:01 — forked from dannguyen/tweet-selenium.py
how to send a tweet through Firefox using Ruby + Selenium
#!/usr/bin/env ruby
require 'selenium-webdriver'
require 'rmagick'
include Magick
browser = Selenium::WebDriver.for :firefox
browser.get 'https://twitter.com'
element = browser.find_element(id: 'signin-email').send_keys('ahmgeek')
password = File.open('./pass.txt', 'r').read.strip
@ahyield
ahyield / Movie_files.txt
Last active October 18, 2015 04:27
Enlightenment with أحماه.
Have you ever wondered, what is a movie file ?
Movie files have a few basic components.
First, the file itself is called a container, and the type of container determines where the information
in the file goes. Examples of containers are AVI and Quicktime. Next, you have a bunch of streams; for example,
you usually have an audio stream and a video stream.
(A "stream" is just a fancy word for "a succession of data elements made available over time".)
The data elements in a stream are called frames. Each stream is encoded by a different kind of codec.
The codec defines how the actual data is COded and DECoded - hence the name CODEC. Examples of codecs are DivX and MP3.
Packets are then read from the stream. Packets are pieces of data that can contain bits of data