👨👩👦
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:orientation="vertical" > | |
<LinearLayout android:id="@+id/activity_webview_toolbar" | |
android:layout_width="fill_parent" | |
android:layout_height="50dp" | |
android:orientation="horizontal" |
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
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_webview); | |
webview = (WebView)this.findViewById(R.id.activity_webview_webview); | |
// Enables javascript | |
WebSettings webSettings = webview.getSettings(); | |
webSettings.setJavaScriptEnabled(true); |
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
-- psql -f setup.sql -U username postgres | |
CREATE USER dbusername WITH PASSWORD 'password'; | |
CREATE DATABASE dbname; | |
GRANT ALL PRIVILEGES ON DATABASE dbname to dbusername; |
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
/** | |
* Called when a button is pressed. | |
*/ | |
@Override | |
public void onClick(View v) { | |
if (v == mBuyButton) { | |
if (Consts.DEBUG) { | |
Log.d(TAG, "buying: " + mItemName + " sku: " + mSku); | |
} |
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
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; | |
NSDate *date = nil; | |
NSError *error = nil; | |
if (![dateFormatter getObjectValue:&date forString:jsonValue range:nil error:&error]) { | |
NSLog(@"Date '%@' could not be parsed: %@", self, error); | |
} |
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
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; | |
NSDate *date = nil; | |
NSError *error = nil; | |
if (![dateFormatter getObjectValue:&date forString:self range:nil error:&error]) { | |
NSLog(@"Date '%@' could not be parsed: %@", self, error); | |
} |
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
// | |
// ViewController.m | |
// Stupid | |
// | |
// Created by Josh Holtz on 12/10/12. | |
// Copyright (c) 2012 RokkinCat. All rights reserved. | |
// | |
#import "ViewController.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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="true" > | |
<shape> | |
<solid | |
android:color="#449def" /> | |
<stroke | |
android:width="1dp" | |
android:color="#2f6699" /> | |
<corners |
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 HomeActivity extends Activity { | |
@Override | |
public void onResume() { | |
super.onResume(); | |
registerReceiver(myBroadcastReceiver, new IntentFilter("com.package.name.BROADCAST_NAME_GOES_HERE")); | |
} | |
@Override | |
public void onPause() { |
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 void getStripeToken(String stripeApi, String cardNumber, String expMonth, String expYear, String cvc) { | |
// Sets basic auth header with Stripe API key and adds post params for number, exp month, exp year, and cvc | |
ParamsRequestData requestData = new ParamsRequestData(); | |
requestData.addBearerAuthHeader(stripeApi); | |
requestData.addParam("card[number]", cardNumber); | |
requestData.addParam("card[exp_month]", expMonth); | |
requestData.addParam("card[exp_year]", expYear); | |
requestData.addParam("card[cvc]", cvc); | |