Skip to content

Instantly share code, notes, and snippets.

View rajraj's full-sized avatar

Rajesh Rajappan rajraj

View GitHub Profile
https://chartio.com/resources/tutorials/how-to-set-the-default-user-password-in-postgresql
@rajraj
rajraj / capybara cheat sheet
Created July 28, 2016 08:11 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')
@rajraj
rajraj / word_extract_pages
Created June 23, 2016 15:01
MS Word Extract Pages
' Macro to Extract pages
Sub mcrExtractPages()
Application.Browser.Target = wdBrowsePage
For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number of Pages")
ActiveDocument.Bookmarks("\page").Range.Copy
Documents.Add
Selection.Paste
ChangeFileOpenDirectory "C:\Temp"
DocNum = DocNum + 1
ActiveDocument.SaveAs FileName:="ExtractedPage_" & DocNum & ".docx"
http://codepen.io/JacobStone420/pen/GfLEn
http://tympanus.net/codrops/2011/11/02/original-hover-effects-with-css3/
http://www.designshifts.com/add-an-off-canvas-sidebar-menu-to-a-wordpress-theme/
@rajraj
rajraj / fedora-install-nodejs.sh
Created December 14, 2015 16:51 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v5.0.0)
#!/usr/bin/env bash
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
#SETUP PARAMS
https://www.youtube.com/watch?v=fzJcrH6dGGs
Running `mix ecto.migrate` attached to terminal... up, run.6992
** (Postgrex.Error) tcp connect: econnrefused
(ecto) lib/ecto/adapters/sql/worker.ex:29: Ecto.Adapters.SQL.Worker.query!/4
(ecto) lib/ecto/adapters/sql.ex:187: Ecto.Adapters.SQL.use_worker/3
(ecto) lib/ecto/adapters/postgres.ex:59: Ecto.Adapters.Postgres.ddl_exists?/3
(ecto) lib/ecto/migration/schema_migration.ex:19: Ecto.Migration.SchemaMigration.ensure_schema_migrations_table!/1
(ecto) lib/ecto/migrator.ex:36: Ecto.Migrator.migrated_versions/1
(ecto) lib/ecto/migrator.ex:134: Ecto.Migrator.run/4
(mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require File.dirname(__FILE__) + '/blueprints'
require 'faker'
require 'rails/test_help'
require 'minitest/autorun'
require 'minitest/pride'
class MiniTest::Unit::TestCase
include MiniTest::ActiveRecordAssertions
module FormatAttributes
def formats(*attributes)
@format_attributes = attributes
end
def format_attributes
@format_attributes
end
end
class Person
attr_reader :name
def initialize(name)
@name = name
end
def introduce
"hello, my name is #{@name}"
end