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 | |
o = request.env["omniauth.auth"] | |
#render :text => o.to_yaml;return; | |
authentication = Authentication.find_by_provider_and_uid(o['provider'],o['uid']) | |
if authentication && authentication.user | |
authentication.token = o['credentials']['token'] | |
authentication.save | |
sign_in authentication.user | |
redirect_to '/profile' | |
return |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Device Properties Example</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="songmint.min.css" rel="stylesheet" type="text/css" /> | |
<link href="jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css" /> | |
<script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title> | |
Viatask - Run your errands, Socially! | |
</title> | |
<link href="/assets/application.css" media="screen" rel= | |
"stylesheet" type="text/css" /> |
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
/* line 1, /srv/rails/viatask/app/assets/stylesheets/home.css.scss */ | |
body.home { | |
background: #6ed3fb; | |
/* Old browsers */ | |
background: -moz-linear-gradient(left, #6ed3fb 0%, #9de4fc 50%, #6ed3fb 100%); | |
/* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, right top, color-stop(0%, #6ed3fb), color-stop(50%, #9de4fc), color-stop(100%, #6ed3fb)); | |
/* Chrome,Safari4+ */ | |
background: -webkit-linear-gradient(left, #6ed3fb 0%, #9de4fc 50%, #6ed3fb 100%); | |
/* Chrome10+,Safari5.1+ */ |
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
<script type="text/javascript" charset="utf-8"> | |
$('#nearbyeventspage').live('pageshow', function() { | |
navigator.geolocation.getCurrentPosition(onSuccess, onError); | |
function onSuccess(position) { | |
nearby_event_url = "http://songmint.net/nearby_events.json/?latitude=" + position.coords.latitude + "&longitude=" + position.coords.longitude; | |
$.getJSON(nearby_event_url, function(data) { | |
if(data.length == 0) { | |
alert("nothing was found"); | |
$("#nearbyeventspage div[data-role=content]").html("nothing was found"); | |
} else { |
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
(function( $ ){ | |
$.fn.scrollable = function() { | |
$(this).mousewheel(function(event, delta, deltaX, deltaY) { | |
if (deltaY < 0) { | |
if ($(this).position().top + $(this).height() > $(window).height()) { | |
$(this).stop(); | |
$(this).animate({ | |
top: '+=' + deltaY * 82 | |
}, 0); | |
} else { |
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 'minitest/autorun' | |
class TestRover < MiniTest::Unit::TestCase | |
def test_rover_operation | |
@plateau = Plateau.new(5,5) | |
@plateau.add_rover(1, 2, 'N') | |
result = @plateau.direct_rover("LMLMLMLMM") | |
assert_equal result, '1 3 N' |
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 Plateau | |
def initialize(height, width) | |
@rovers = [] | |
$width = width | |
$height = height | |
end | |
def add_rover(x, y, h) | |
@rovers << Rover.new(x, y, h) |
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 "rexml/document" | |
require "NMLParse/song" | |
class NMLParse | |
attr_accessor :songs | |
def initialize | |
@songs = [] | |
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
#This solution is only an example and doesn't have to be concrete. Caleb can change it to how he wants it to function, and he can play around with additional functionality if he likes. =) | |
print "Hello, what's your name?\n" | |
name = gets.downcase.chomp | |
#Adding .downcase to the gets function turns "MoM" into "mom" for example. | |
#When you press enter upon entering your name it adds a special character to the end called a "newline" character. | |
#A newline character looks like this: \n | |
#We don't need this invisible character, so we remove it with the .chomp method. |