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 Message < ActiveRecord::Base | |
belongs_to :user | |
accepts_nested_attributes_for :user | |
end | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, |
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
RestService restService; | |
restService = new RestService(mHandler, this, "http://10.0.2.2:3000/bars/"); | |
restService.addParam("lat", "40764917"); //Add params to request | |
restService.addParam("lng", "-73983130"); | |
restService.addParam("range", "10"); | |
restService.addHeader("Content-Type","application/json");//Add headers to request | |
//Overridden handler to process incoming response. | |
private final Handler mHandler = new Handler(){ | |
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
private static void check(FTPClient ftp, String cmd, boolean succeeded) throws IOException { | |
if (!succeeded) { | |
throw new IOException("FTP error: " + ftp.getReplyString()); | |
} | |
} | |
private static String today() { | |
return new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
} |
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
public class SMSLauncher extends BroadcastReceiver | |
{ | |
public static final String SMS_EXTRA_NAME = "pdus"; | |
@Override | |
public void onReceive(Context context, Intent intent) | |
{ | |
Bundle extras = intent.getExtras(); | |
String messages = ""; | |
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 googleApiBuilder; | |
public class ApiBuilderTrap { | |
public static void main(String args[]){ | |
String query = ""; | |
int x = -74008713; | |
int y = 40752459; | |
int yint = 40752459; | |
double efficiency = .9069; |
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
RestService restServiceG; | |
//Create the progress dialog and show it, before running your restService request | |
Final ProgressDialog dialog = new ProgressDialog(mContext); | |
dialog.setMessage("Please wait.. Retrieving"); | |
dialog.setIndeterminate(true); | |
dialog.setCancelable(true); | |
dialog.show(); |
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].each do |level| %> | |
<% unless flash[level].blank? %> | |
<script type="text/javascript"> | |
$('#myModal').modal('show') | |
</script> | |
<% 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
Started POST "/customers/3/tabs" for 127.0.0.1 at Mon Jun 18 14:02:36 -0400 2012 | |
Processing by TabsController#create as HTML | |
Parameters: {"commit"=>"Create Tab", "authenticity_token"=>"2bJBuyENTUg/lOLjU7s1WdCESTAYEFM/CroNCWFWAWE=", "customer_id"=>"3", "tab"=>{"is_open"=>"1", "current_price"=>"0", "closed_price"=>"0", "bar_id"=>""}, "utf8"=>"✓"} | |
SQL (0.5ms) INSERT INTO "tabs" ("bar_id", "closed_price", "created_at", "current_price", "customer_id", "is_open", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["bar_id", nil], ["closed_price", 0], ["created_at", Mon, 18 Jun 2012 18:02:36 UTC +00:00], ["current_price", 0], ["customer_id", nil], ["is_open", true], ["updated_at", Mon, 18 Jun 2012 18:02:36 UTC +00:00]] | |
Redirected to http://localhost:3000/tabs/4 | |
Completed 302 Found in 12ms | |
#Tab Controller | |
def new |
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 sublime_plugin | |
class NextGroup(sublime_plugin.WindowCommand): | |
def run(self): | |
numGroups = self.window.num_groups() | |
currentGroup = self.window.active_group() | |
if currentGroup < numGroups - 1: | |
newGroup = currentGroup + 1 | |
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
import sublime_plugin | |
class NextViewInGroup(sublime_plugin.WindowCommand): | |
def run(self): | |
currentGroup, currentViewIndex = self.window.get_view_index(self.window.active_view()) | |
currentViews = self.window.views_in_group(currentGroup) | |
if currentViewIndex < len(currentViews) - 1: | |
newView = currentViews[currentViewIndex + 1] | |
else: |
OlderNewer