This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 } |
NewerOlder