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
Script baseLineData execution took 0.33139801025391 seconds <br />Array | |
( | |
[1] => Array | |
( | |
[6] => Array | |
( | |
[median] => 19 | |
[minimum] => 18 | |
[maximum] => 22 | |
) |
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
Script baseLineData execution took 0.31350111961365 seconds <br />Array | |
( | |
[0] => Array | |
( | |
[0] => 21 | |
[1] => 21 | |
[2] => 21 | |
[3] => 21 | |
[4] => 21 | |
[5] => 21 |
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
<?php | |
//Pull historical daily; assumes that historical has at least as many years as the generated. | |
$sql = "select * from verde_historical_daily where year <= :year"; | |
$core = Core::getInstance(); | |
$stmt = $core->dbh->prepare($sql); | |
$stmt->bindParam(':year', $totalYears, PDO::PARAM_INT); | |
try { | |
$stmt->execute() |
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 'fileutils' | |
start_time = Time.now | |
SOURCE_DB = { | |
:name => 'db_name', | |
:user => 'db_user', | |
:password => 'db_pass', | |
:host => 'localhost' |
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
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
// Global My App Namespace | |
window.myapp = window.myapp || {}; | |
// AJAX Namespace | |
myapp.ajax = myapp.ajax || {}; | |
myapp.ajax.csrf = '98dd0f785e'; | |
myapp.ajax.paths = { |
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
-- Function: im_detalle_1_actualiza_ingreso() | |
-- DROP FUNCTION im_detalle_1_actualiza_ingreso(); | |
CREATE OR REPLACE FUNCTION im_detalle_1_actualiza_ingreso() | |
RETURNS trigger AS | |
$BODY$ | |
DECLARE | |
-- Declaramos las variables con el mismo tipo del definido en la tabla | |
iva_5 ingreso_mercaderia.im_impuesto_5%TYPE; |
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 "mechanize" | |
require "csv" | |
agent = Mechanize.new | |
page = agent.get("http://www.embarcadero.com/index.php?option=com_mmportfolio&view=projects&layout=appshowcase&format=raw") | |
projects = [] | |
page.search("div.appitem").each do |item| | |
puts "Fetching: " + item.text | |
id = item["rel"] | |
name = item.text |
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
# MultIO Ruby IO multiplexer | |
# http://rcrowley.org/2010/07/27/multio-ruby-io-multiplexer.html | |
require 'stringio' | |
class MultIO < Array | |
def <<(io) | |
if io.respond_to?(:to_str) | |
io = StringIO.new(io) |
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
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# | |
# Retrieve an iOS app icon at the highest available resolution | |
# All arguments are combined to create an iTunes search | |
# The icon for the first result, if found, is written to a filename based on search terms | |
# | |
# example: | |
# $ itunesicon super monsters ate my condo |
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
------------ From Rake Task | |
namespace :app do | |
# Checks and ensures task is not run in production. | |
task :ensure_development_environment => :environment do | |
if Rails.env.production? | |
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)" | |
end | |
end |