Skip to content

Instantly share code, notes, and snippets.

Sahal sahal8020

Block or report user

Report or block sahal8020

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 yardoc_cheatsheet.md

YARD CHEATSHEET http://yardoc.org

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
# @since 0.6.0
@sahal8020
sahal8020 / gist:10a1b2d3f025cbc18e2bfaa94908fe84
Created Aug 12, 2016 — forked from Jauny/gist:3876531
Understanding blocks, Procs and lambda!
View gist:10a1b2d3f025cbc18e2bfaa94908fe84

#Understanding blocks, Procs and lambdas. I think blocks, Procs and lambdas are working in a really counter-intuitive way when you
first try to understand how they work, and most of the (amazing) resources one can find online
are too complicated to allow to understand how they work without frustration...

So here is my take on it; I'll try to make it as simple and concise as possible,
and will focus on how it is used, instead of how it works under the hood.

##Blocks A block is simply a piece of code that will (usually) execute something;

View ruby_manipulation_tricks.md

Ruby Gems Manipulation

"hmm, so they didn't give you a decent api to make the changes you need.."

"Can't touch this"

Methods

Removing

@sahal8020
sahal8020 / state_machine.md
Created May 25, 2016
androidstate_machine.md
View state_machine.md

HierarchicalSM

A state machine which processes messages and can have states arranged hierarchically.

Usage

Construction

State

@sahal8020
sahal8020 / burger.rb
Last active Mar 2, 2016
Meat transformed into a Burger using Ruby's subclassing, include and prepend
View burger.rb
class Meat
def burger
puts "meat"
end
end
class SauceAndMeat < Meat
def burger
puts "sauce"
super # "meat"
View middleman.md

Middleman

In simple terms, Middleman or any static site generator produces static website, made of HTML, CSS and Java Script files, which can be uploaded to any static host or served from any normal web server. Static, informational, one-way broadcast content sites are often called "brochureware" and are ideal for blogs, curriculum vitae, portfolios, etc.

Middleman is a library for creating static websites written in Ruby, which utilizes some of the power of Rails (the popular Ruby web framework). An easy to use framework, Middleman allows you to build static websites with modern workflows in mind and with a high degree of developer

View Params.md

Params

HTTP/HTML Params

  • Series of key-value pairs (e.g. key: 'value'). Both are strings
  • Come from the user's browser when they request the page
  • Encoded in the url
Example

For an HTTP GET request, if a user's browser requested

You can’t perform that action at this time.