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 2013 Google Inc. All rights reserved. | |
* | |
* 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
// 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
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
// 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
public class ApiModule { | |
private TwitterApi mApi; | |
public void init(String token, String tokenSecret) { | |
OAuthConsumer consumer = new DefaultOAuthConsumer( | |
Config.TWEET_API_KEY, | |
Config.TWEET_API_SECRET); | |
consumer.setTokenWithSecret(token, tokenSecret); |
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
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
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
<?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
package com.flavienlaurent.notboringactionbar; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** | |
* Created by f.laurent on 21/11/13. | |
* antoine-merle.com inspiration |
NewerOlder