Skip to content

Instantly share code, notes, and snippets.

View vargheseraphy's full-sized avatar

Raphy Varghese vargheseraphy

View GitHub Profile
Option Explicit
Private Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Dim Ret As Long
'~~> This is where the images will be saved. Change as applicable

12 Most Engaging Presenter Behaviors…to Keep Your Audience Awake

  • Start by telling your audience what they will take away from your talk.
    • (1) organize a talk and save hours of time;
    • (2) categorize information on your slides and keep your audience engaged
    • (3) feel more confident and excited about giving a presentation.
  • Speak less than the time allotted.
  • Use silence effectivel
  • Pause periodically
  • Emphasize key words
@vargheseraphy
vargheseraphy / RubyGsub.md
Last active August 29, 2015 14:19
String#gsub is one of the most used Ruby methods in the wild. Just about every Ruby programmer knows about the method and uses it fairly regularly.

Using Ruby's Gsub With a Block

String#gsub is one of the most used Ruby methods in the wild. Just about every Ruby programmer knows about the method and uses it fairly regularly.

Here’s a quick refresher of the typical gsub usage:

# using string match
'John Wayne'.gsub('John', 'Bruce')
=> "Bruce Wayne"
@vargheseraphy
vargheseraphy / regex_to_match_words.md
Created April 13, 2015 09:12
Ruby Regexp group matching, assign variables on 1 line

Ruby Regexp group matching,

You don't want scan for this, as it makes little sense. You can use String#match which will return a MatchData object, you can then call #captures to return an Array of captures. Something like this:

#!/usr/bin/env ruby

string = "RyanOnRails: This is a test"
one, two, three = string.match(/(^.*)(:)(.*)/i).captures
@vargheseraphy
vargheseraphy / ruby_tricks.md
Last active August 29, 2015 14:19
21 Ruby Tricks You Should Be Using In Your Own Code

21 Ruby Tricks You Should Be Using In Your Own Code

http://www.rubyinside.com/21-ruby-tricks-902.html

1 - Extract regular expression matches quickly

A typical way to extract data from text using a regular expression is to use the match method. There is a shortcut, however, that can take the pain out of the process:

email = "Fred Bloggs "
#!/usr/bin/env ruby
require 'pdf/reader' # gem install pdf-reader
# credits to :
# https://github.com/yob/pdf-reader/blob/master/examples/text.rb
# usage example:
# ruby pdf2txt.rb /path-to-file/file1.pdf [/path-to-file/file2.pdf..]
ARGV.each do |filename|
PDF::Reader.open(filename) do |reader|
@vargheseraphy
vargheseraphy / linux_commands.md
Created April 12, 2015 11:55
usefull linux terminal commands
@vargheseraphy
vargheseraphy / pdf_reader.md
Last active January 7, 2019 04:53
Reading content fro a pdf

Parsing .PDF’s with Ruby

In our journey through the world of test automation with ruby we have found that sometimes the data we need to validate is locked up in some .pdf formatted file and can be difficult to get at. The 3Qi Labs team decided there had to be a way to automate the extraction and parsing of these PDF’s within our test automation scripts and the search began. Enter Xpdf.

There are many programs/ruby libraries that can do a the parsing job we need done such as PDFMiner, PoDoFo, Origami, and the PDF-Reader gem, but we have found Xpdf to be a the best choice for our needs to both view and parse out the data from pdf files when your testing includes doing some validation of the contents of generated pdf files. Xpdf is an open source viewer for Adobe “.pdf” files that includes a set of utilities to do just about everything you would want to do to a PDF: extracting the PDF’s info or attachments or images or converting the PDF to a bitmap format, but the utility we are after here is Xpdf’s text

@vargheseraphy
vargheseraphy / git_bloging.md
Last active August 29, 2015 14:18
Create and write your blogs using github pages