Skip to content

Instantly share code, notes, and snippets.

View normancapule's full-sized avatar

John Norman Capule normancapule

View GitHub Profile
@normancapule
normancapule / Database Cleaner Issue
Created January 21, 2013 06:46
Cucumber-rails default database cleaner action is to delete all data regardless of any specific config in env.rb. This resulted to Scenario 2 failing without removing the database_cleaner gem in the Gemfile.
#admin_signup.feature
@retain
Feature: User Signup
In order to signup
As a new user
I want to be able to create an admin user account
And edit this user's company profile
@retain
Scenario: Register in Truetime as an Admin.
@normancapule
normancapule / gist:5210368
Created March 21, 2013 02:57
Intermittent error occuring in rails 3.2.11
#error trace
Started GET "/" for 124.6.182.55 at 2013-03-21 13:40:08 +1100
Processing by DashboardsController#show as HTML
Rendered activities/_slip_activity.html.erb (4.4ms)
Rendered slips/_form.html.erb (19.8ms)
Rendered slips/_delete_button.html.haml (1.9ms)
Rendered slips/_slip.html.erb (27.5ms)
Rendered activities/_group_header.html.erb (0.2ms)
Rendered activities/_activity.html.erb (19.7ms)
Rendered activities/_group_header.html.erb (0.1ms)
@normancapule
normancapule / gist:5351404
Created April 10, 2013 02:57
Staging Server 125.7.122.15
FIREWALL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP all -- anywhere 208.83.120.130
@normancapule
normancapule / gist:5402145
Created April 17, 2013 06:16
Xero Posting Error
SSL_CTX_use_certificate:: x509 lib
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:776:in `initialize'
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:776:in `new'
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:776:in `connect'
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:744:in `start'
/home/ncapule/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:1284:in `request'
/home/ncapule/.rvm/gems/ruby-1.9.3-p125@truetime/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
/home/ncapule/.rvm/gems/ruby-1.9.3-p125@truetime/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/instrumentation/net.rb:25:in `block in request_with_newrelic_trace'
/home/ncapule/.rvm/gems/ruby-1.9.3-p125@truetime/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/cross_app_tracing.rb:39:in `trace_http_request'
###############
#application.js
###############
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
.row
.col-lg-12.col-md-12.col-sm-12.text-center
%p.header-text Checkout Order
.row#checkout
.col-lg-5.col-lg-offset-1.col-md-5.col-md-offset-1.col-sm-5.col-sm-offset-1.col-xs-5.col-xs-offset-1
= form_for @personal_information, url: checkout_index_path, method: :post do |f|
= render 'shipping', f: f
= render 'billing'
= render 'confirmation'
.col-lg-5.col-md-5.col-sm-5.col-xs-5
@normancapule
normancapule / deploy.rb
Created March 5, 2014 13:50
Sample Capistrano 3.1 Config
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, '<application_name>'
set :repo_url, '<url.git>'
set :deploy_via, :remote_cache
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
### DISCLAIMER: UNTESTED ###
def self.on_range(top, bottom, schedule_type=nil)
days = ((top.to_date)..(bottom.to_date))
weekdays = days.map(&:wday).uniq
months = days.map{|me| me.strftime("%m")}.uniq
years = days.map{|me| me.strftime("%Y")}.uniq
query = ""
query += "schedule_type = '#{schedule_type}' and " if schedule_type
// Generated on 2014-07-04 using generator-angular 0.9.2
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
var modRewrite = require('connect-modrewrite');
@normancapule
normancapule / gist:ddbd8afc79d2494fb75b
Created November 5, 2014 08:10
Protractor Chrome Driver error
Running "protractor:chrome" (protractor) task
Starting selenium standalone server...
Selenium standalone server started at http://10.0.4.1:47357/wd/hub
[launcher] Error: UnknownError: unknown error: Chrome version must be >= 36.0.1985.0
(Driver info: chromedriver=2.12.301324 (de8ab311bc9374d0ade71f7c167bad61848c7c48),platform=Linux 3.14.22-031422-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.49 seconds
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'localhost', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.14.22-031422-generic', java.version: '1.8.0_25'