Skip to content

Instantly share code, notes, and snippets.

@rebelwarrior
rebelwarrior / README.md
Created October 22, 2012 05:51 — forked from briangonzalez/README.md
img2boxshadow - a ruby script to convert images to CSS [http://codepen.io/briangonzalez/details/AvrGI#pen-details-tab]

img2boxshadow.rb

a ruby script to convert images to CSS (box-shadows)

Installation

gem install rmagick    # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@rebelwarrior
rebelwarrior / ColorString.rb
Last active November 20, 2017 15:36
Color String Module for quick color in CLI apps
##### ======= Color Strings =======
module ColorString
def red(string)
STDOUT.tty? ? "\033[31m#{string}\033[0m\n" : string #31
end
def green(string)
STDOUT.tty? ? "\033[32m#{string}\033[0m\n" : string #32
end
def yellow(string)
STDOUT.tty? ? "\033[33m#{string}\033[0m\n" : string #33
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
#!/Users/username/.rvm/rubies/jruby-1.7.11/bin/jruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# jruby.bash - Start Script for the JRuby interpreter
#
# Environment Variable Prequisites
#
# JRUBY_OPTS (Optional) Default JRuby command line args
# JRUBY_SHELL Where/What is system shell
#
# JAVA_HOME Must point at your Java Development Kit installation.
# Traducciones adicionales en https://github.com/plataformatec/devise/wiki/I18n
es:
devise:
confirmations:
confirmed: "Su cuenta ha sido confirmada."
confirmed_and_signed_in: "Su cuenta ha sido confirmada. Ha sido identificado correctamente."
send_instructions: "Recibira un correo electrónico en unos minutos con instrucciones sobre cómo restablecer su contraseña."
send_paranoid_instructions: "Si su correo electrónico existe en nuestra base de datos recibirás un correo electrónico en unos minutos con instrucciones sobre cómo reiniciar su contraseña."
failure:

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rebelwarrior
rebelwarrior / rspec_model_testing_template.rb
Created November 9, 2015 16:56 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems: