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
# Convert a string in the expected format, into 16 bytes, emulating .Net's | |
# Guid constructor. | |
# "00000000-0000-0000-0000-000000000000" => | |
# [CLSCompliantAttribute(false)] | |
# public Guid( | |
# uint a, | |
# ushort b, | |
# ushort c, | |
# byte d, | |
# byte e, |
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
def conference_date_string(conf) | |
startstr = "Unknown - " | |
endstr = "Unknown" | |
# When the conference in the same motn | |
if conf.start_date.month == conf.end_date.month and conf.start_date.year == conf.end_date.year | |
startstr = conf.start_date.strftime("%B %d - ") | |
endstr = conf.end_date.strftime("%d, %Y") | |
elsif conf.start_date.month != conf.end_date.month && conf.start_date.year == conf.end_date.year | |
startstr = conf.start_date.strftime("%B %d - ") | |
endstr = conf.end_date.strftime("%B %d, %Y") |
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="linuxtycooon-app"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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
class Person < ActiveRecord::Base | |
has_many :orders | |
has_many :lines, :through => :products | |
has_many :products, :through => :lines | |
end | |
class Order < ActiveRecord::Base | |
has_many :lines | |
has_many :products, :through => :lines | |
end |
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
def class Cart < ActiveRecord::Base | |
#... | |
def installation_instructions_pdf(pdf = nil) | |
pdf ||= Prawn::Document.new | |
eval(IO.read("app/views/cards/installation.pdf.prawn")) | |
end | |
#... |
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
<span id="update_me">Some text that needs to be updated.</span> | |
<%=link_to_remote "Update", :url => "/update/something", :update => 'update_me' %> | |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'gdata' | |
PROJECT_PATH = "/your/project/path" | |
DOMAIN = 'your_google_apps_domain_or_blank_for_any_google_account.com' |
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
# clear a table | |
Given /^I have no (\S+)$/ do |table| | |
ActiveRecord::Base.connection.execute "DELETE FROM `#{table.tableize}`" | |
end | |
# create a new instance, as an @underscore_named_var, and @it. | |
Given /^I have a new (\S+)$/ do |model| | |
eval "@#{model.underscore} = #{model.classify}.new" | |
eval "@it = #{model.classify}.new" | |
end |
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
class Core < ActiveResource::Base | |
self.site = case Rails.env | |
when 'production' | |
"http://core.yamatoengines.com" | |
else | |
"http://localhost:3005" | |
end | |
end |
OlderNewer