Skip to content

Instantly share code, notes, and snippets.

Avatar

Rajesh Rajappan rajraj

View GitHub Profile
View gist:68640a4b20dd6c1d6605143f063931c3
https://chartio.com/resources/tutorials/how-to-set-the-default-user-password-in-postgresql
View 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 Jun 23, 2016
MS Word Extract Pages
View 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"
View gist:20e0a4aa731d797373e2
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 Dec 14, 2015 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v5.0.0)
View fedora-install-nodejs.sh
#!/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
View gist:938eda1a5fc5a18c409b
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
View gist:6dab98d25da375c98154
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
View modules-example.rb
module FormatAttributes
def formats(*attributes)
@format_attributes = attributes
end
def format_attributes
@format_attributes
end
end
View person.rb
class Person
attr_reader :name
def initialize(name)
@name = name
end
def introduce
"hello, my name is #{@name}"
end