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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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/env ruby | |
require 'rubygems' | |
require 'roo' | |
pwd = File.dirname(__FILE__) | |
Dir.glob("#{pwd}/*.xls") do |file| | |
file_path = "#{pwd}/#{file}" | |
file_basename = File.basename(file, ".xls") | |
xls = Excel.new(file_path) |
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
t1 = (Time.now-6.months).beginning_of_month # Start Date Time | |
t2 = (Time.now).end_of_month # End Date and Time | |
t = t1 | |
amounts = [155, 140, 160] | |
from = "Banashankari 3rd Satge, Vyalikaval" | |
to = "Vyalikaval, Banashankari 3rd Satge" | |
month = t.month | |
year = t.year | |
leaves = {"26/01/2012" => "Republic Day", "23/03/2012" => "Chandramana Ugadi", "01/05/2012" => "May Day", "15/08/2012" => "Independence Day", "19/09/2012" => "Ganesha Chaturthi", "02/10/2012" => "Gandhi Jayanti", "23/10/2012" => "Audha Pooja", "01/11/2012" => "Kannada Rajyotsava", "12/11/2012" => "Naraka Chaturdashi", "14/11/2012" => "Balipadyami" } |
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
activerecord (3.2.13) lib/active_record/persistence.rb:347:in `create_or_update' | |
activerecord (3.2.13) lib/active_record/callbacks.rb:264:in `block in create_or_update' | |
activesupport (3.2.13) lib/active_support/callbacks.rb:425:in `_run__3652904023592825844__save__1349650235203356801__callbacks' | |
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback' | |
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_save_callbacks' | |
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks' | |
activerecord (3.2.13) lib/active_record/callbacks.rb:264:in `create_or_update' | |
activerecord (3.2.13) lib/active_record/persistence.rb:84:in `save' | |
activerecord (3.2.13) lib/active_record/validations.rb:50:in `save' | |
activerecord (3.2.13) lib/active_record/attribute_methods/dirty.rb:22:in `save' |
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
➜ my_store rvm:(ruby-2.0.0) bundle update | |
Fetching https://github.com/spree/spree.git | |
remote: Counting objects: 130666, done. | |
remote: Compressing objects: 100% (48435/48435), done. | |
remote: Total 130666 (delta 82214), reused 119957 (delta 72967) | |
Receiving objects: 100% (130666/130666), 27.04 MiB | 380.00 KiB/s, done. | |
Resolving deltas: 100% (82214/82214), done. | |
Updating https://github.com/spree/spree_gateway.git | |
Updating https://github.com/spree/spree_auth_devise.git | |
Updating git://github.com/suryart/spree_active_sale.git |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.13' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
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 'spec_helper' | |
describe 'Orders' do | |
let!(:product) { create(:product, :available_on => 1.day.ago) } | |
stub_authorization! | |
before(:each) do | |
visit spree.admin_path | |
click_link "Products" |
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
[#<Spree::Product id: 1, name: "Product #1 - 6731", description: "Dicta tenetur maxime velit facere. In quisquam odit...", available_on: "2013-07-02 18:13:39", deleted_at: nil, permalink: "product-number-1-6731", meta_description: nil, meta_keywords: nil, tax_category_id: 1, shipping_category_id: 1, created_at: "2013-07-03 18:13:40", updated_at: "2013-07-03 18:13:40">] | |
#<Spree::Product id: 1, name: "Product #1 - 6731", description: "Dicta tenetur maxime velit facere. In quisquam odit...", available_on: "2013-07-02 18:13:39", deleted_at: nil, permalink: "product-number-1-6731", meta_description: nil, meta_keywords: nil, tax_category_id: 1, shipping_category_id: 1, created_at: "2013-07-03 18:13:40", updated_at: "2013-07-03 18:13:40"> | |
/products/product-number-1-6731 | |
F | |
Failures: | |
1) Orders should allow a user to see product name | |
Failure/Error: find('.product-title').text.should equal product.name | |
Capybara::ElementNotFound: |
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
# Configure Rails Environment | |
ENV['RAILS_ENV'] = 'test' | |
require File.expand_path('../dummy/config/environment.rb', __FILE__) | |
require 'rspec/rails' | |
require 'database_cleaner' | |
require 'ffaker' | |
require 'factory_girl' |
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/ruby1.9.2 | |
# encoding: utf-8 | |
class Node | |
attr_accessor :src, :dst, :length | |
def initialize(src, dst, length = 1) | |
@src = src | |
@dst = dst | |
@length = length | |
end |
OlderNewer