Skip to content

Instantly share code, notes, and snippets.

@jmif
jmif / create_client.rb
Created April 22, 2012 18:32
Rails Two Legged OAuth DB Migration
class Client < ActiveRecord::Migration
def change
create_table :client do |t|
t.string :api_key
t.string :secret
t.timestamps
end
end
end
# Import the settings dev file if we are developing
if os.environ.get('DEVELOPMENT', None):
from login.settings_dev import *
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));
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;
/**
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