Skip to content

Instantly share code, notes, and snippets.

View koalahamlet's full-sized avatar
㊙️
shhhh

Michael Alan Huff koalahamlet

㊙️
shhhh
View GitHub Profile
package venmo.michaelhuff.sf5dayforecast;
import javax.inject.Inject;
import javax.inject.Singleton;
import dagger.Component;
/**
* Created by koalahamlet on 2/3/15.
*/
@koalahamlet
koalahamlet / famousUniversity101.md
Last active August 29, 2015 14:13
My initial review and notes of Famo.us University 101 course

Here are my notes about the Famo.us University 101

  • ** --> concepts
  • ## --> things to possibly improve

In general, there needs to be a reset code button. There were a few times in the course of progressing through everything that it would have been more helpful to have 'reset code' button rather than Ctrl+z-ing my way back to the start.

=============================================================================

Famo.us 101: Displaying content.

  • #####step 1 Displaying Content Introduces the concept of a *renderable*.
@koalahamlet
koalahamlet / notWorkingWell.java
Last active August 29, 2015 14:11
Fragments, how do they work?
@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") {
openers_to_closers_map = {
'(' : ')',
'{' : '}',
'[' : ']'
}
openers = openers_to_closers_map.keys()
closers = openers_to_closers_map.values()
def is_valid(code):
openers_stack = []
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 = " "
@koalahamlet
koalahamlet / MetricDetailFragment.java
Last active August 29, 2015 14:08
general patter for custom loader animation
private WebView webView;
private ImageView loaderImage;
private AnimationDrawable frameAnimation;
...
alias yolo="git commit -am '(•_•) ( •_•)>⌐■-■ (⌐■_■) DEAL WITH IT' && git push -f origin master"
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();
}
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
};
@koalahamlet
koalahamlet / gist:4db8a946562c4daf9ba2
Created August 14, 2014 21:37
revoke android access G+
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);