Skip to content

Instantly share code, notes, and snippets.

View redrory's full-sized avatar

Rory Walker redrory

View GitHub Profile
$(document).ready(function(){
console.log('eee');
var seconds = 1;
setInterval(
function(){
document.getElementById('seconds').innerHTML = --seconds;
// }, 10);
})
$("a.add").click(function(){
@redrory
redrory / current_p
Created September 5, 2011 11:28
Current project
params[:username] ||= 'redrory'
list = Net::HTTP.get URI.parse("http://github.com/api/v2/yaml/repos/show/#{params[:username]}")
@repos = YAML::load(list)["repositories"]
Failures:
1) Tasks GET /tasks display some tasks
Failure/Error: @task = Task.create :task => 'go to the store'
ActiveRecord::StatementInvalid:
Could not find table 'tasks'
# ./spec/requests/tasks_spec.rb:5:in `block (3 levels) in <top (required)>'
Finished in 0.00714 seconds
4 examples, 1 failure, 3 pending
rake db:test:prepare
alias cdf='cd Code/Ruby/Filmbet' # With only three characters I jump in the project that I'm working with.
How about
alias cdf='cd Code/Ruby/Filmbet && rails s ' #I start the server too :)
To do this I had to make the change in my .bash_profile file.
I always mixup, is it vim ~/. or vim ~./, especailly in typing it normally comes out wrong.
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Unpaid Jobs</a></li>
<li><a href="#tab2" data-toggle="tab">Paid Jobs</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<%= render :partial => "shared/feed_item", :feed_item1 => @feed_item1s %>
@redrory
redrory / _feed_item.html.erb
Created April 27, 2013 23:49
Trying to show different partials
<li id="<%#= client.id %>">
<table class = "table table-striped table-hover">
<tr>
<th>Company</th>
<th>Project Name</th>
<th>Due Date</th>
<th>Amount</th>
<th>Days Left</th>
<th>Status</th>
<th>Action</th>
@redrory
redrory / client.rb
Created May 21, 2013 20:14
My client model, when I send the email reminders. Problem is, I would like to send user information, not sure how to pass in the correct
## My daily mail function that sorts through who should be sent email reminders, then passes that
##infomation to the mailer function
## The client side works [Line 18 ], it finds all appropriate clients and sends to them
## However I decided that I want to include information from User.
## User has many clients, So the person that signs up is the User, and the clients are sent email reminders.
##My issue is that, I wasn't sure how to pass in the correct user instance into the Reminder.daily_mail email function
## When I try it how it done now, it sents emails reminders with ALL users. @user = User.current_user doesn't work.
## When I try to do a block each user, it send loops and send multiple emails.
@redrory
redrory / Gemfile.rb
Created August 10, 2013 13:43
Installing better_errors & binding_of_caller
group :development do
gem 'better_errors'
gem 'binding_of_caller'
end
@redrory
redrory / button.html.erb
Last active January 2, 2016 15:09
Currently, when you find an event (if - successful ). It loads my modal via index.js.erb That works fine, however I want to load a different set of modals if an event is not found (else). However, on the else condition; it doesn't load the index.js.erb
<h3>Enter your talk code</h3>
<%= simple_form_for @event, remote: true ,:method => 'get' do |e| %>
<div class="talknumber"><%= text_field_tag :checkin, params[:search] %></div>
<%= e.button :submit, "Checkin", :class => "btn btn-default" %>
<% end %>