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
module Jekyll | |
class GooglePlusEmbedTag < Liquid::Tag | |
@post = nil | |
@height = '' | |
@width = '' | |
def initialize(tag_name, markup, tokens) | |
if markup =~ /(https:\/\/plus.google.com\/\d+\/posts\/\w+)/i | |
@url = $1 |
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
repo forall -c ' | |
if git rev-parse android-4.0.3_r1 >/dev/null 2>&1 | |
then | |
git log --oneline --no-merges android-4.0.3_r1..android-4.0.4_r1.1 | |
else | |
git log --oneline --no-merges android-4.0.4_r1.1 | |
fi | |
' | cat |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:ads="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> |
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
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** | |
* Thanks to StackOverflow | |
* @link http://stackoverflow.com/a/15264039/425050 | |
*/ | |
public class SquareImageView extends ImageView { |
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
afterEvaluate { project -> | |
android.applicationVariants.each { variant -> | |
variant.javaCompile.dependsOn stripPlayServices | |
} | |
} | |
task stripPlayServices << { | |
def explodedDir = project.tasks.findAll { it.name.startsWith("prepare") && it.name.endsWith("Library")}.iterator().next().explodedDir.getParentFile().getParentFile().getParentFile() | |
def playServiceRootFolder = new File(explodedDir, "com.google.android.gms/play-services/") | |
playServiceRootFolder.list().each { versionName -> |
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
# Write on | |
mount -o remount,rw -t ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system | |
# verbose logging in sqlite | |
adb shell setprop log.tag.SQLiteLog V | |
adb shell setprop log.tag.SQLiteStatements V | |
adb shell stop | |
adb shell start | |
# Check dependencies of app subproject |
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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* Change this line inside the WebDialog.java class: | |
https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/widget/WebDialog.java#L60 | |
to the code block below. | |
*/ | |
public static final int DEFAULT_THEME; | |
static { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
DEFAULT_THEME = R.style.FbDialog; |
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
(function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} | |
function h() { |
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
Amazon War Story #1: Jeff Bezos | |
Over the years I watched people give presentations to Jeff Bezos and come back bruised: emotionally, intellectually, often career-ily. If you came back with a nod or a signoff, you were jumping for joy. Presenting to Jeff is a gauntlet that tends to send people back to the cave to lick their wounds and stay out of the sunlight for a while. | |
I say “presentations” and you probably think PowerPoint, but no: he outlawed PowerPoint there many years ago. It’s not allowed on the campus. If you present to Jeff, you write it as prose. | |
One day it came time for me to present to Jeff. It felt like... I don’t know, maybe how they swarm around you when you’re going to meet the President. People giving you last-minute advice, wishing you luck, ushering you past regiments of admins and security guards. It’s like you’re in a movie. A gladiator movie. | |
Fortunately I’d spent years watching Jeff in action before my turn came, and I had prepared in an unusual way. My presentation -- which, roughl |