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
int location_wait_time = getApplicationContext().getResources() | |
.getInteger(R.integer.location_poll_minutes); | |
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
Intent intent = new Intent(this, LocationReceiver.class); | |
PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), | |
0, intent, 0); | |
//Register for broadcast intents |
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
package com.midwestfleet.receivers; | |
import android.accounts.Account; | |
import android.accounts.AccountManager; | |
import android.app.PendingIntent; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
/** |
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
int[] location = new int[2]; | |
this.anchor.getLocationOnScreen(location); | |
Rect anchorRect = | |
new Rect(location[0], location[1], location[0] + this.anchor.getWidth(), location[1] | |
+ this.anchor.getHeight()); | |
this.anchorRectangle = anchorRect; | |
this.root.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); |
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 the settings dev file if we are developing | |
if os.environ.get('DEVELOPMENT', None): | |
from login.settings_dev import * |
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 Client < ActiveRecord::Migration | |
def change | |
create_table :client do |t| | |
t.string :api_key | |
t.string :secret | |
t.timestamps | |
end | |
end | |
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
require 'rack' | |
require 'rack/request' | |
require 'oauth' | |
class ApplicationController < ActionController::Base | |
before_filter :run_oauth_check | |
# ... | |
protected | |
def run_oauth_check |
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 action="[YOUR ACTION]" method="post" accept-charset="UTF-8"> | |
<input id="user_username" style="margin-bottom: 15px;" type="text" name="user[username]" size="30" /> | |
<input id="user_password" style="margin-bottom: 15px;" type="password" name="user[password]" size="30" /> | |
<input id="user_remember_me" style="float: left; margin-right: 10px;" type="checkbox" name="user[remember_me]" value="1" /> | |
<label class="string optional" for="user_remember_me"> Remember me</label> | |
<input class="btn btn-primary" style="clear: left; width: 100%; height: 32px; font-size: 13px;" type="submit" name="commit" value="Sign In" /> | |
</form> |
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() { | |
// Setup drop down menu | |
$('.dropdown-toggle').dropdown(); | |
// Fix input element click problem | |
$('.dropdown input, .dropdown label').click(function(e) { | |
e.stopPropagation(); | |
}); | |
}); |
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
Resque::Job.create('jobs', QuickJob) | |
Resque::Job.create('jobs', QuickJob) | |
w1 = Resque::Worker.new('*') | |
w2 = Resque::Worker.new('*') | |
w1.work(0) do. | |
w2.work(0) do. | |
4.should == 3 | |
end | |
end |
OlderNewer