Skip to content

Instantly share code, notes, and snippets.

View gkilmain's full-sized avatar

gkilmain

View GitHub Profile
<record-text>Regular text</record-text>
<record-text class="title">Title text</record-text>
@gkilmain
gkilmain / templatestuff.html
Last active May 13, 2018 00:03
Angular Template stuff
<ng-template #loginButtons>
<button (click)="login()">{{loginText}}</button>
<button (click)="signUp()">{{signUpText}}</button>
</ng-template>
<ng-template #logoText>
<h3>Super Awsome Logo Text</h3>
</ng-template>
<ng-template #logo>
@gkilmain
gkilmain / index.html
Created December 10, 2013 22:07
index.html
<!DOCTYPE html>
<html>
<head>
<title>Email One Off</title>
<style type="text/css"></style>
</head>
<body>
<form action="process.php" method="POST">
<p>To</p>
<input type="text" name="to" id="to" />
/home/george/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
12:32:46 web.1 | from /home/george/workspace/openbay/lib/gem_ext/active_model/secure_password.rb:39:in `has_openbay_secure_password'
12:32:46 web.1 | from /home/george/workspace/openbay/app/models/service_station/employee.rb:10:in `<class:Employee>'
12:32:46 web.1 | from /home/george/workspace/openbay/app/models/service_station/employee.rb:3:in `<top (required)>'
12:32:46 web.1 | from /home/george/.rvm/gems/ruby-1.9.3-p374@openbay/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:469:in `load'
12:32:46 web.1 | from /home/george/.rvm/gems/ruby-1.9.3-p374@openbay/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:469:in `block in load_file'
12:32:46 web.1 | from /home/george/.rvm/
#this is my console after I commented out 'Capybara.server_boot_timeout = 50' in spec_helper.rb
george@ubuntu:~/workspace/openbay$ rspec spec
No DRb server is running. Running in local process instead ...
Finished in 0.21461 seconds
0 examples, 0 failures
/usr/lib/ruby/gems/1.9.1/gems/headless-1.0.1/lib/headless/cli_util.rb:9:in `ensure_application_exists!': Xvfb not found on your system (Headless::Exception)
from /usr/lib/ruby/gems/1.9.1/gems/headless-1.0.1/lib/headless.rb:68:in `initialize'
from /home/george/workspace/openbay/spec/spec_helper.rb:37:in `new'
class AddExpiresAtToOffer < ActiveRecord::Migration
def change
add_column :offers, :expires_at, :date
Offer.reset_column_information
Offer.find_each do |offer|
puts '...running loop'
offer.update_attribute(:expires_at, offer.created_at + 6.months)
offer.save
before_save :set_expiration_date #once its been saved update the expires_at attribute with the set_expiration_method
def expired?
if accepted! #if an offer has been accepted it cannot expire
return false
else
created_at > expires_at #if created_at is greater than expires_at return true, else return false
end
end
projects/index
<h1>Listing projects</h1>
<br />
<div id="projects_list">
<% @projects.each do |project| %>
<%= project.name %><br>
<% end %>
</div>
@gkilmain
gkilmain / app.js
Created December 10, 2014 13:20
custom checkbox
angular.module('app', [])
.controller('MainCtrl', MainCtrl)
.directive('checkBox', checkBox);
function checkBox() {
var directive = {
controller: Controller,
link: link,
restrict: 'E',
require: 'ngModel',
@gkilmain
gkilmain / index
Created August 26, 2014 20:04
JS BJ
.card {
width: 50px;
height: 100px;
border: 1px solid #ccc;
border-radius: 4px;
float: left;
margin: 5px;
}