This file contains 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 onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { | |
FragmentManager manager = getFragmentManager(); | |
FragmentTransaction fts = manager | |
.beginTransaction(); | |
// lazy instantiation for the win | |
if (tab.getTag() == "PoiListFragment") { |
This file contains 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
openers_to_closers_map = { | |
'(' : ')', | |
'{' : '}', | |
'[' : ']' | |
} | |
openers = openers_to_closers_map.keys() | |
closers = openers_to_closers_map.values() | |
def is_valid(code): | |
openers_stack = [] |
This file contains 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
for (var i = 1; i < 13; i++) { | |
var str = ""; | |
for (var j = 1; j < 13; j++) { | |
var num = i*j; | |
var spacer; | |
if (num <= 9) { | |
spacer = " " | |
} | |
else if (num <= 99 ){ | |
spacer = " " |
This file contains 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 WebView webView; | |
private ImageView loaderImage; | |
private AnimationDrawable frameAnimation; | |
... | |
This file contains 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
alias yolo="git commit -am '(•_•) ( •_•)>⌐■-■ (⌐■_■) DEAL WITH IT' && git push -f origin master" |
This file contains 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 setAccountName(String name) { | |
mAccountName = name; | |
SharedPreferences settings = getSharedPreferences(SHARED_PREFS, 0); | |
SharedPreferences.Editor editor = settings.edit(); | |
editor.putString(ACCT_NAME, mAccountName); | |
editor.commit(); | |
} |
This file contains 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 ArrayList<String> getGooglePlusToken() { | |
ArrayList<String> accessTokens = new ArrayList<>(); | |
try { | |
String accountName = Plus.AccountApi.getAccountName(googleApiClient); | |
String scope = "audience:server:client_id:" + Constants.GOOGLE_PLUS_SERVER_CLIENT_ID; | |
accessTokens.add(GoogleAuthUtil.getToken(context, accountName, scope)); | |
Object[] scopes = { | |
Scopes.PLUS_LOGIN | |
}; |
This file contains 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 revokeGplusAccess() { | |
if (mGoogleApiClient.isConnected()) { | |
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient); | |
Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient) | |
.setResultCallback(new ResultCallback<Status>() { | |
@Override | |
public void onResult(Status arg0) { | |
Log.e(TAG, "User access revoked!"); | |
mGoogleApiClient.connect(); | |
updateUI(false); |
This file contains 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
var troll = prompt("You're walking through the forest, minding your own business, and you run into a troll! Do you FIGHT him, PAY him, or RUN?").toUpperCase(); | |
switch(troll) { | |
case 'FIGHT': | |
var strong = prompt("How courageous! Are you strong (YES or NO)?").toUpperCase(); | |
var smart = prompt("Are you smart?").toUpperCase(); | |
if(strong === 'YES' || smart === 'YES') { | |
console.log("You only need one of the two! You beat the troll--nice work!"); | |
} else { | |
console.log("You're not strong OR smart? Well, if you were smarter, you probably wouldn't have tried to fight a troll. You lose!"); |
This file contains 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 advanced; | |
import com.sandwich.koan.Koan; | |
import static com.sandwich.util.Assert.fail; | |
public class AboutMocks { | |
static interface Collaborator { | |
public void doBusinessStuff(); | |
} |