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"?> | |
<resources> | |
<color name="flatui_turquoise">#1abc9c</color> | |
<color name="flatui_emerland">#2ecc71</color> | |
<color name="flatui_peter_river">#3498db</color> | |
<color name="flatui_amethyst">#9b59b6</color> | |
<color name="flatui_wet_asphalt">#34495e</color> | |
<color name="flatui_green_sea">#16a085</color> | |
<color name="flatui_nephritis">#27ae60</color> | |
<color name="flatui_belize_hole">#2980b9</color> |
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
sed -i '' 's/foo/bar/g' **/* |
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 void setBackgroundResource(View v, int id) { | |
int bottom = v.getPaddingBottom(); | |
int top = v.getPaddingTop(); | |
int right = v.getPaddingRight(); | |
int left = v.getPaddingLeft(); | |
v.setBackgroundResource(id); | |
v.setPadding(left, top, right, bottom); | |
} |
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
// prefetch image https://plus.google.com/+Tom%C3%A1%C5%A1Linhart/posts/MA3oieUpWXj | |
Picasso.with(context).load(url).skipMemoryCache().fetch() |
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
// run in chrome developer console | |
var tables = $(".main table"); | |
var TD = '<td style="width:40px; text-align:center">'; | |
function fill_rank(st, ed){ | |
var rank = 1; | |
for(var i=st; i<ed; i++){ | |
$(tables[i]).find("tr").each(function(){ | |
var row = $(this); | |
var td = $(row.find("td")[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
set bgFile to "path/to/wallpaper.jpg" | |
tell application "System Events" | |
repeat with i from 1 to 7 | |
set theDesktops to (a reference to every desktop) | |
repeat with x from 1 to (count theDesktops) | |
set picture of item x of the theDesktops to bgFile | |
end repeat | |
delay 1 | |
key code 124 using control down | |
end repeat |
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
// https://developer.android.com/training/material/animations.html | |
// ?android:attr/selectableItemBackground |
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
// get meta-data from AndroidManifest.xml | |
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); | |
String meta = ai.metaData.getString("key"); | |
// get version name and version code | |
PackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0); | |
String versionName = pinfo.versionName; | |
int versionCode = pinfo.versionCode; |
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
<resources xmlns:android="http://schemas.android.com/apk/res/android"> | |
<style name="AppTheme" parent="android:Theme.Light" /> | |
<style name="FP"> | |
<item name="android:layout_width">fill_parent</item> | |
<item name="android:layout_height">fill_parent</item> | |
</style> | |
<style name="WC"> | |
<item name="android:layout_width">wrap_content</item> |
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 class TextHelper { | |
public static SpannableString strikeText(String text){ | |
if (text==null)text = ""; | |
SpannableString str = new SpannableString(text); | |
str.setSpan(new StrikethroughSpan(), 0, str.length(), Spanned.SPAN_PARAGRAPH); | |
return str; | |
} | |
public static SpannableString underlineText(String text){ | |
if (text==null)text = ""; | |
SpannableString str = new SpannableString(text); |
OlderNewer