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 - This file is used to start-up the Rails Server on this app automatically or by clicking it. | |
REM - Open and save this file as a .bat and drop it in Windows Start -> All Programs -> start up folder. | |
REM - Point the path below to the app (stockist) for it to work. Let me know if nothing works. | |
CD C:\ssing\Sites\stockist | |
rails server webrick -p 3000 -e production | |
ECHO Hello Sam, Your Rails app (Stockist) is running. Press any key to close this window if it persists |
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
# Using gem prawn_rails try and put this results to a pdf in a nice format as follows: | |
# For each first and second array elements show the rest of the array with the following headers i.9ie | |
# STYLE(i[0]), COLUR(i[1]), SIZE(i[3]), STOCK(i[4]), MIN_STOCK(i[6]), REQUIRED(i[7]) | |
[ | |
["UD/BAG/PE/EXTRAZIP/BLACK", "**PLAIN", " |----- |", "BLACK PE BAG +ZIP", -12, 16, 28, "00015463", 0] | |
["UD/BAG/PE/EXTRAZIP/MAROON", "EAGLE PRIMARY(LN)", " |----- |", "MAROON PE BAG +ZIP", -15, 8, 23, "00015477", 0] | |
["UD/BAG/PE/EXTRAZIP/NAVY", "METHERINGHAM PRIMARY SCHOO(LN)", " |----- |", "NAVY PE BAG +ZIP", 3, 8, 5, "00015472", 0] | |
["UD/BAG/PE/EXTRAZIP/NAVY", "ST FAITH AND ST MARTIN COF(LN)", " |----- |", "NAVY PE BAG +ZIP", 11, 14, 3, "00015474", 0] | |
["UD/BAG/PE/EXTRAZIP/NAVY", "ST HUGHS CATHOLIC PRIMARY (LN)", " |----- |", "NAVY PE BAG +ZIP", -1, 14, 15, "00015475", 0] |
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
# gem install rdbi rdbi-driver-odbc | |
require "rdbi-driver-odbc" | |
dbh = RDBI.connect( | |
:ODBC, | |
:db => "db_name", | |
:username => "db_username", | |
:password => "db_password" | |
) |
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
worker_processes 1; | |
user nobody nogroup; | |
pid /tmp/nginx.pid; | |
error_log /tmp/nginx.error.log; | |
events { | |
worker_connections 1024; | |
accept_mutex off; | |
} | |
http { | |
default_type application/octet-stream; |
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
NoMethodError - undefined method `user_signed_in?' for #<#<Class:0x007ff4e946dff8>:0x007ff4eef44648>: | |
(gem) spree_core-1.3.2/app/helpers/spree/base_helper.rb:162:in `method_missing' | |
app/views/spree/shared/_nav_bar.html.erb:2:in `_6fd4240c6a08c5260228ac2bcf10cc4a' | |
(gem) actionpack-3.2.13/lib/action_view/template.rb:145:in `block in render' | |
(gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in `block in instrument' | |
(gem) activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument' | |
(gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument' | |
(gem) actionpack-3.2.13/lib/action_view/template.rb:143:in `render' | |
(gem) deface-0.9.1/lib/deface/action_view_extensions.rb:37:in `render' | |
(gem) actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:265:in `render_partial' |
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
# encoding: utf-8 | |
require "rubygems" | |
require "net/telnet" | |
# request_params = "T,,01,0000,,,,,,,10.00,0.00000,,,,,,,,,,,\n" | |
begin | |
puts 'Trying.....' | |
printo = Net::Telnet::new( "Host" => "192.168.2.37", "Port" => 25000, "Telnetmode" => true ) |
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
the-crab$ git push heroku master | |
Counting objects: 970, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (829/829), done. | |
Writing objects: 100% (970/970), 5.09 MiB | 327 KiB/s, done. | |
Total 970 (delta 110), reused 0 (delta 0) | |
-----> Ruby/Rails app detected | |
-----> Using Ruby version: ruby-1.9.3 | |
-----> Installing dependencies using Bundler version 1.3.2 |
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
# Verifone Error codes. There are 215 codes and they are [-1...-189] and [-999...-1014]. Just take the important ones :=( | |
error_codes = [ | |
[ code: "-0", description: "Unspecified error", action: "Contact VeriFone" ], | |
[ code: "-1", description: "Invalid transaction type", action: " Use alternative method for transaction type" ], | |
[ code: "-2", description: " ", action: "" ], | |
[ code: "-3", description: " ", action: "" ], | |
[ code: "-4", description: " ", action: "" ], | |
[ code: "-5", description: " ", action: "" ], | |
[ code: "-6", description: " ", action: "" ], | |
[ code: "-7", description: " ", action: "" ], |
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 "net/telnet" | |
params = " | |
T, ##= 1 String [required] Message Type. 'T' to be passed, to define a transaction record | |
, ##= 2 Account Number. This field is no longer used. Use Field 24 | |
01, ##= 3 Integer [required] Transaction Type. ‘01’ – Purchase, ‘02’ – Refund, ‘04’ – Cash advance | |
0000, ##= 4 Integer [required] Modifier. | |
, ##= 5 Reserved, Leave Blank | |
, ##= 6 Reserved, Leave Blank |
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
module AuthenticationHelpers | |
def sign_in_as!(user) | |
visit '/login' | |
fill_in 'Email', :with => user.email | |
fill_in 'Password', :with => "secret" | |
click_button 'Login' | |
end | |
end | |
RSpec.configure do |config| |