This file contains 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
{if $anchor} | |
<a name="{$anchor}"></a> | |
{/if} | |
<script type="text/javascript"> | |
{literal} | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('div.rotating_banner').bxSlider({ |
This file contains 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
require 'rubygems' | |
require 'mechanize' | |
require 'progressbar' | |
docs = File.readlines('URLS.txt') | |
pb = ProgressBar.new('downloading', docs.length) | |
docs.each do |line| | |
url = line.strip | |
if !File.exist?(File.basename(url)) |
This file contains 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 PLANT_NAME as 'plant name', [2009Q2], [2009Q3], [2009Q4], [2010Q1], [2010Q2], [2010Q3], [2010Q4], [2011Q1], [2011Q2], [2011Q3], [2011Q4], [2012Q1] | |
FROM | |
( | |
SELECT PLANT_CODE as plant, [QUARTER] as qtr FROM RECALL..[TREND_IR_FINDINGS] | |
WHERE CC_ASPECT LIKE '%H1b%' | |
) AS src | |
PIVOT | |
( | |
COUNT(qtr) FOR qtr IN ([2009Q2], [2009Q3], [2009Q4], [2010Q1], [2010Q2], [2010Q3], [2010Q4], [2011Q1], [2011Q2], [2011Q3], [2011Q4], [2012Q1]) | |
) AS pvt |
This file contains 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 | |
REM Run as administrator, I think :-/ | |
REM Download and install ruby 1.9.3 | |
REM Download and install devkit: ruby dk.rb init & ruby dk.rb install | |
call gem install rake -v 0.9.2.2 --no-ri --no-rdoc | |
call gem install json -v 1.7.3 --no-ri --no-rdoc | |
call gem install rdoc -v 3.12 --no-ri --no-rdoc | |
call gem install jquery-rails -v 2.0.2 --no-ri --no-rdoc | |
REM ytf does this have old rails 3.2.6 requirements | |
call gem install sprockets -v 2.4.4 --no-ri --no-rdoc |
This file contains 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
require 'rubygems' | |
require 'benchmark' | |
require 'bundler' | |
Bundler.setup | |
require 'prawn' | |
require 'ruby-debug' | |
sources = ['ML091590492.pdf', 'file1.pdf', 'file2.pdf'] | |
document = Prawn::Document.new(:template => sources.first) |
This file contains 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
<xsl:template match="colspec[not(@colnum)]"> | |
<xsl:element name="colspec"> | |
<xsl:attribute name="colnum">1</xsl:attribute> | |
<xsl:apply-templates select="@*|node()" /> | |
</xsl:element> | |
</xsl:template> |
This file contains 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
require 'net/http' | |
class Pdf::ConcatenatorsController < ApplicationController | |
respond_to :html, :js, :json, :xml | |
def index | |
pdf_concatenators = PdfConcatenator.all | |
respond_with @pdf_concatenators | |
end |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SpreadsheetUtil.rollup()</title> | |
<style> | |
body, textarea { | |
font-family: 'Lucida Console', 'Consolas', courier; | |
color: #7f7; | |
} |
This file contains 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
json.cache! model.cache_key do | |
json.(model, *%i(id name description created_at super_long_running_helper_method)) | |
json.foo foo # 'bar' | |
# ... | |
end |
This file contains 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
# Calls attributes on obj, returning results as a hash. Be careful to never | |
# run this code with user-provided attributes. | |
# | |
# Example: | |
# as_hash_from_object(user, ["first_name", "last_name", "account.name"]) | |
# #=> {"first_name" => "Aaron", "last_name" => "Breckenridge", "account.name" => "System Root"} | |
def as_hash_from_object(object, attribs) | |
attribs.each_with_object({}) do |attrib, hash| | |
hash[attrib] = attrib.split('.').reduce(object) { |o, i| o.respond_to?(i) ? o.send(i) : nil } | |
end |
OlderNewer