Skip to content

Instantly share code, notes, and snippets.

View elfassy's full-sized avatar

Michael Elfassy elfassy

View GitHub Profile
elfassy / github-project-issues.rb
Last active June 3, 2024 13:39
Github Project Issues
require 'bundler/inline'
gemfile do
source ''
gem 'csv'
gem 'graphql-client'
gem 'progressbar'
gem 'pry'
gem 'pry-byebug'
require 'graphql/client/http'
#=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click_on('Button Value')
function applePayButtonClicked(event)
var paymentRequest = {
// countryCode: The merchant’s ISO country code.
countryCode: 'US',
// currencyCode: The ISO currency code for the payment.
currencyCode: 'USD',
// total: The total amount for the payment.
total: {
label: 'Canine Clothing',
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
gemfile(true) do
source ''
gem 'activerecord', '4.2.0'
elfassy / hstore_getter_setter.rb
Created September 5, 2012 18:55
hstore meta programming
module HstoreSetterGetter
# To use simply add to your models:
# include HstoreSetterGetter
# hstore_attributes :test1, :test2, type: :integer #assumes column_name: :data
# hstore_attributes :test3, :test4, column_name: :properties #assumes type: :string
# Written by Michael Elfassy
# Setup a template that can be cloned later
# Command:
# rails new NAME -m setup_template.rb
# (by default you should use "template" as NAME)
plugin("Rename", :git => "")
# See if you need more customization of the template generator
#!/usr/bin/env ruby
require "rubygems" # ruby1.9 doesn't "require" it though
require "thor"
class CloneRails < Thor
include Thor::Actions
desc "new NAME, TEMPLATE", "Create a new rails app based on a template app"
method_options :template => "template"
def new(name)
puts "Copying the template..."
elfassy / image_tag_helper.rb
Created September 24, 2011 15:40
better image_tag
#Orverwrite the image_tag based on the idea from Designer Wall (
def image_tag(source, options = {})
image_width = image_height = nil
image_width_css = image_height_css = ""
options[:class] = "image-wrap " + options[:class]