Skip to content

Instantly share code, notes, and snippets.

View cintrzyk's full-sized avatar

Marcin Brzeziński cintrzyk

  • stackin.com
  • Olsztyn
View GitHub Profile
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
def expected_date? (str)
DateTime.strptime(str, '%d, %B, %Y') > Date.today-7
end
def get_page (number)
#!/usr/bin/env ruby
require "skrypt"
require "test/unit"
class TestSkrypt < Test::Unit::TestCase
def test_title_match
assert(true) do
title_match?("Row","Row")
end
@cintrzyk
cintrzyk / _expense_fields.html.erb
Created November 12, 2012 21:33
_form.html.erb (wallet new view)
<%= f.input :name, label: 'Expense name', class: 'control-label' %>
<%= f.input :amount, as: :currency, wrapper: 'prepend' %>
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require rails.validations.simple_form
//= require_tree .
//= require_self
<div class="row expense_amount">
<div class="control-group string required error">
<label class="string required control-label" for="wallet_expenses_attributes_0_name">
<abbr title="required"></abbr> Expense name
</label>
<div class="controls">
<input class="string required" id="wallet_expenses_attributes_0_name" name="wallet[expenses_attributes][0][name]" size="50" type="text" value="" />
<span class="help-inline">is too short (minimum is 3 characters)</span>
</div>
</div>
@cintrzyk
cintrzyk / git
Created November 26, 2012 19:10
You asked me to pull without telling me which branch you
want to rebase against, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often rebase against the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
@cintrzyk
cintrzyk / gist:7703477
Created November 29, 2013 09:35
Publish test
it 'should make publish' do
visit edit_lead_catcher_path(unpublished_lead_cat, format: :js)
find('.title', text: 'Settings').click
find('input[name=publish]').should_not be_checked
check 'publish'
click_link 'save'
wait_for_ajax
expect(unpublished_lead_cat.published).to be
end
@cintrzyk
cintrzyk / gist:7703625
Created November 29, 2013 09:54
publish error
No DRb server is running. Running in local process instead ...
[Zonebie] Setting timezone to "Mountain Time (US & Canada)"
You are using WebMock 1.16.0. VCR 2.8.0 has been tested against WebMock >= 1.8.0, < 1.16, and you are using a newer version. If you experience VCR issues, consider downgrading WebMock as it may fix it.
Run options: include {:line_numbers=>[48]}
An error occurred in an after hook
ActionView::Template::Error: undefined method `[]' for nil:NilClass
occurred at /Users/cinek/netguru/dwhite/app/views/member/page_templates/builtin/template_2.haml:5:in `_app_views_member_page_templates_builtin_template___haml__651274039841050535_70220375396360'
F
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
<div id='first'>
@cintrzyk
cintrzyk / file11.txt
Created October 28, 2015 17:11
the description for this gist
String file contents