This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| IF EXIST c:\ruby18 GOTO switch_19 | |
| IF EXIST c:\ruby19 GOTO switch_18 | |
| echo No alternate ruby environment found. | |
| GOTO print_version | |
| :switch_19 | |
| echo Switching to Ruby 1.8... | |
| rename c:\ruby ruby19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -wKU | |
| require "rexml/document" | |
| require 'FileUtils' | |
| include REXML | |
| # Update the xml | |
| Dir.glob( "./*.bafxml" ) do |batch_file| | |
| puts batch_file.to_s | |
| doc = REXML::Document.new File.new( batch_file, 'r' ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'net/smtp' | |
| def send_mail(options = {}) | |
| begin | |
| puts "Assembling mail..." | |
| options = { | |
| :smtp_server => '555.55.55.555', | |
| :from => '[email protected]', | |
| :to => '[email protected]', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Select e.EncounterNo, e.EncntrStartDate, EncntrType, EncntrClass, IpOpInd | |
| From Encounters as e | |
| Left Outer Join #valid_encounters as ve on e.EncntrOwnerId = ve.EncntrOwnerId | |
| Where e.EncntrStartDate >= '1/1/2000' and e.EncntrStartDate < '1/1/2010' | |
| AND ve.EncntrOwnerId is null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -wKU | |
| # | |
| # A practical example of using modules is the process of making tacos. | |
| # There are 4 main modules: main, Ingredients, Prep, and Serve | |
| # | |
| module TacoBell | |
| class Tacos | |
| def initialize(style = "Mild") | |
| @style = style |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT YEAR(ModifyDateTime) as document_year, | |
| COUNT(TotalKB) as document_count, | |
| (SUM(TotalKB)/1024)/1024 as document_size_gb | |
| FROM Documents as d | |
| INNER JOIN DocTypes as dt ON d.DocType = dt.DocType | |
| INNER JOIN DocArchStg as das ON d.DocID = das.Docid | |
| INNER JOIN DocsOwners as do ON d.DocId = do.DocId | |
| INNER JOIN Encounters as e ON do.OwnerId = e.EncntrOwnerId | |
| GROUP BY YEAR(ModifyDateTime) WITH ROLLUP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible | |
| source $VIMRUNTIME/vimrc_example.vim | |
| source $VIMRUNTIME/mswin.vim | |
| behave mswin | |
| set diffexpr=MyDiff() | |
| function MyDiff() | |
| let opt = '-a --binary ' | |
| if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif | |
| if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -wKU | |
| require 'rubygems' | |
| require 'fastercsv' | |
| require 'yaml' | |
| begin | |
| # Gather the encounter information | |
| map = YAML::load( File.new( 'encounter-map.yml', 'r' ) ) | |
| encounters = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -wKU | |
| require 'rexml/document' | |
| require 'rubygems' | |
| require 'RedCloth' | |
| include REXML | |
| doc = Document.new( File.new( 'bpack.xml', 'r' ) ) | |
| XPath.match( doc, "//pages/page" ).each do |page| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <lesson title="" lang="EN" version=""> | |
| <pages> | |
| <page title="" number=""> | |
| <text><![CDATA[]]></text> | |
| <overlays> | |
| <overlay type="txt|img|swf|qt"> | |
| <source></source> | |
| <xloc></xloc> | |
| <yloc></yloc> |