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
// 1. Create this file in your Xcode project | |
// 2. Go to "Build Settings" and find "Objective-C Bridging Header." Use the search bar to find it quickly. | |
// 3. Double-click and type "BridgingHeader.c" | |
// If you get "Could not import Objective-C Header," try "my-project-name/BridgingHeader.h" | |
// 4. Go to "Build Phases," "Link Binary With Libraries," and add libsqlite3.0.dylib | |
#include <sqlite3.h> |
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
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb | |
index 3f08f9e..fe0d2cc 100644 | |
--- a/activerecord/test/cases/nested_attributes_test.rb | |
+++ b/activerecord/test/cases/nested_attributes_test.rb | |
@@ -1000,6 +1000,12 @@ class TestHasOneAutosaveAssociationWhichItselfHasAutosaveAssociations < ActiveRe | |
ShipPart.create!(:ship => @ship, :name => "Stern") | |
assert_no_queries { @pirate.valid? } | |
end | |
+ | |
+ test "not sure yet" do |
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
# Partially stolen from: http://davidsulc.com/blog/2011/05/01/self-marking-required-fields-in-rails-3/ | |
class ActionView::Helpers::FormBuilder | |
alias :orig_label :label | |
# add a 'required' class to the field label if the field is required | |
def label(method, content_or_options = nil, options={}, &block) | |
if content_or_options && content_or_options.class == Hash | |
options = content_or_options | |
else |
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var canvas = $('canvas#pong'); | |
var context = canvas[0].getContext('2d'); | |
var players = [{position: {x: 10, y: 30}}, {position: {x: 900, y: 00}}]; | |
var config = {player: {width: 30, height: 150}}; | |
var ball = {position: {x: 100, y: 100}, velocity: {x: 3, y: 0}, width: 15, height: 15}; | |
var angle_coefficient = -1/50; |
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
<style> | |
body { | |
background-color: black; | |
color: white; | |
font-family: sans-serif; | |
text-align: center; | |
} | |
#minutes { | |
font-size: 500px; | |
} |
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 'json' | |
require 'cgi' | |
require 'httparty' | |
module GMap | |
module Location | |
def latitude | |
read_attribute(:latitude) || fetch_coordinates_from_address.latitude | |
end |