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 create | |
@cart = current_cart | |
product = Product.find(params[:product_id]) | |
@line_item = @cart.add_product(product.id) | |
respond_to do |format| | |
if @line_item.save | |
format.html { redirect_to(store_url)} | |
format.js { @current_item = @line_item } | |
format.xml { render :xml => @line_item, :status => :created, :location => @line_item } |
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
import java.awt.Robot; | |
import java.awt.AWTException; | |
import java.awt.event.KeyEvent; | |
public class robo_test | |
{ | |
Robot rob; | |
public robo_test() throws AWTException |
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
<%= form_for(@person) do |f| %> | |
<% if @person.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@person.errors.count, "error") %> prohibited this person from being saved:</h2> | |
<ul> | |
<% @person.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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 User < ActiveRecord::Base | |
belongs_to :person | |
belongs_to :user_type | |
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 Person < ActiveRecord::Base | |
belongs_to :company | |
has_one :user | |
accepts_nested_attributes_for :user | |
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
Error: | |
Error mounting: mount exited with exit code 1: helper failed with: | |
mount: wrong fs type, bad option, bad superblock on /dev/sdb1, | |
missing codepage or helper program, or other error | |
In some cases useful info is found in syslog - try | |
dmesg | tail or so | |
dmesg | tail output: |
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
require 'rubygems' | |
require 'mechanize' | |
require 'open-uri' | |
def internet_connection? | |
begin | |
true if open("http://www.google.com") | |
rescue | |
false | |
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
<?php | |
class WP_Publication_Archive { | |
public static $mimetypes = array( | |
'application/pdf' => 'pdf', | |
'application/postscript' => 'pdf', | |
'application/zip' => 'zip', | |
'audio/basic' => 'audio', | |
'audio/mp4' => 'audio', |
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
name of display: :0 | |
display: :0 screen: 0 | |
direct rendering: Yes | |
server glx vendor string: SGI | |
server glx version string: 1.4 | |
server glx extensions: | |
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, | |
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, | |
GLX_OML_swap_method, GLX_SGI_swap_control, GLX_SGIS_multisample, | |
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, |
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
// 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 | |
// the compiled file. | |
// | |
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
OlderNewer