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 com.tokudu.begemot.widgets; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.Checkable; | |
import android.widget.CheckedTextView; | |
import android.widget.LinearLayout; | |
/* |
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"?> | |
<com.tokudu.begemot.widgets.CheckableLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:padding="5dip" | |
android:orientation="vertical" | |
> | |
<CheckedTextView | |
android:id="@+id/user_name" |
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
<?php | |
function debug($var = false) { | |
echo "\n<pre style=\"background: #FFFF99; font-size: 10px;\">\n"; | |
$var = print_r($var, true); | |
echo $var . "\n</pre>\n"; | |
} | |
?> |
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
#!/bin/bash | |
# SSH into an EC2 instance by name | |
# Author: [email protected] (SoThree.com). | |
set -e | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: `basename $0` instance_name" | |
exit 1 | |
fi |
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
#!/bin/bash | |
# Updates all EC2 instances from git | |
# Author: [email protected] | |
CODE_LOCATION=/var/www/your_project | |
SERVER_PREFIX=your_project | |
# exit if something fails | |
set -e |
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
<script>(function(d, s, id) { | |
var js, ujs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//umano.me/widgets/player.min.js"; | |
ujs.parentNode.insertBefore(js, ujs); | |
}(document, 'script', 'umano-jssdk'));</script> | |
<div class="umano-player" data-canonical="http://pandodaily.com/2012/11/21/umano-wants-to-tell-you-the-news-literally"> | |
</div> |
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
String str = "Some really long string goes in here"; | |
Spannable spannable = new SpannableString(str); | |
spannable.setSpan(new BackgroundColorSpan( | |
getResources().getColor(android.R.color.black) | |
), 0, str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
yourTextView.setText(spannable); |
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.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.text.style.LineBackgroundSpan; | |
public class PaddingBackgroundColorSpan implements LineBackgroundSpan { | |
private int mBackgroundColor; | |
private int mPadding; | |
private Rect mBgRect; |
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
int padding = 10; // in pixels | |
yourTextView.setShadowLayer(padding /* radius */, 0, 0, 0 /* transparent */); | |
yourTextView.setPadding(padding, padding, padding, padding); | |
// Now create the new span | |
String str = "Some really long string goes in here"; | |
Spannable spannable = new SpannableString(str); | |
spannable.setSpan(new PaddingBackgroundColorSpan( | |
getResources().getColor(android.R.color.black), | |
padding |
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
#!/bin/bash | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
TIMESTAMP=`date +%F-%H%M` | |
S3_CONFIG="/home/ubuntu/.s3cfg" | |
CHUNK_SIZE="500m" # 500 mg | |
DUMPS_TO_KEEP=30 | |
if [ $# -lt 2 ] |
OlderNewer