22 Mar 2015 It is very easy to see the actual libraries that are used for your project. You just go to .idea
folder and then to libraries
folder where the actual libraries will reside.

22 Mar 2015 This is how you can easily throttle Android networking interface on the emulator. You can go via telnet or netcat.
##TL;DR To set the network interface to have throughput of 6000 bits/s (0.7 KB/s) and 2000 ms latency you would use these commands (for the first emulator that usually defaults to port 5554)
echo "network delay 2000" | nc localhost 5554
echo "network speed 6 6" | nc localhost 5554
Goto Full Post 19 Mar 2015 If you (or someone else) have pushed a /Pods
folder into the repository (or any other file that is not supposed to be there) by mistake, there’s a way to permanently remove the file(s) from the repo. The filter-branch
option may be a little more complicated than doing rebase but it is very effective and will remove the files from all the branches.
Here’s the recipe to remove the Pods
folder. You can change the file/path matching and also limit the command for range of commits
Step 1: filter-branch
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all
Step 2: push –force
This will clean the unwanted Pods
folder from the repository. It will not rewrite the log commits though and the commit messages will still be there.
*Loosely based on: https://help.github.com/articles/remove-sensitive-data/
19 Mar 2015 A collection of the special sign for the special keys for OS X with the accompanying Unicode codes.
Sign | Name | Unicode |
⎋ | Escape | U+238B |
⇥ | Tab forward | U+21E5 |
⇤ | Tab back | U+21E4 |
⇪ | Capslock | U+21EA |
⇧ | Shift | U+21E7 |
⌃ | Control | U+2303 |
⌥ | Option (Alt, Alternative) | U+2325 |
| Apple symbol 1 | U+F8FF |
⌘ | Command (Open Apple) 2 | U+2318 |
␣ | Space | U+2423 |
⏎ ↩ | Return | U+23CE/U+21A9 |
⌫ | Delete back | U+232B |
⌦ | Delete forward | U+2326 |
﹖⃝ | Help | U+003F & U+20DD |
⇱ ↖ ↸ | Home | U+21F1 / U+2196 /U+21B8 |
⇲ ↘ | End | U+21F2 / U+2198 |
⇞ | Pageup | U+21DE |
⇟ | Pagedown | U+21DF |
↑ ⇡ | Up arrow | U+2191 / U+21E1 |
↓ ⇣ | Down arrow | U+2193 / U+21E3 |
← ⇠ | Left arrow | U+2190 / U+21E0 |
→ ⇢ | Right arrow | U+2192 / U+21E2 |
⌧ | Clear | U+2327 |
⇭ | Numberlock | U+21ED |
⌤ | Enter | U+2324 |
⏏ | Eject | U+23CF |
⌽ | Power 3 | U+233D |
15 Mar 2015 Google Play services API split by individual service
Google+
compile 'com.google.android.gms:play-services-plus:6.5.+'
Google Account Login
compile 'com.google.android.gms:play-services-identity:6.5.+'
Google Activity Recognition
compile 'com.google.android.gms:play-services-location:6.5.+'
Google App Indexing
compile 'com.google.android.gms:play-services-appindexing:6.5.+'
Google Cast
compile 'com.google.android.gms:play-services-cast:6.5.+'
Google Drive
compile 'com.google.android.gms:play-services-drive:6.5.+'
Google Fit
compile 'com.google.android.gms:play-services-fitness:6.5.+'
Google Maps
compile 'com.google.android.gms:play-services-maps:6.5.+'
Google Mobile Ads
compile 'com.google.android.gms:play-services-ads:6.5.+'
Google Panorama Viewer
compile 'com.google.android.gms:play-services-panorama:6.5.+'
Google Play Game services
compile 'com.google.android.gms:play-services-games:6.5.+'
Google Wallet
compile 'com.google.android.gms:play-services-wallet:6.5.+'
Android Wear
compile 'com.google.android.gms:play-services-wearable:6.5.+'
Google Actions
Google Analytics
Google Cloud Messaging
compile 'com.google.android.gms:play-services-base:6.5.+'
Source block:
Copy and uncomment the ones that you need
// Google+
// compile "com.google.android.gms:play-services-plus:6.5.+"
// Google Account Login
// compile "com.google.android.gms:play-services-identity:6.5.+"
// Google Activity Recognition
// compile "com.google.android.gms:play-services-location:6.5.+"
// Google App Indexing
//compile "com.google.android.gms:play-services-appindexing:6.5.+"
// Google Cast
//compile "com.google.android.gms:play-services-cast:6.5.+"
// Google Drive
//compile "com.google.android.gms:play-services-drive:6.5.+"
// Google Fit
//compile "com.google.android.gms:play-services-fitness:6.5.+"
// Google Maps
//compile "com.google.android.gms:play-services-maps:6.5.+"
// Google Mobile Ads
//compile "com.google.android.gms:play-services-ads:6.5.+"
// Google Panorama Viewer
//compile "com.google.android.gms:play-services-panorama:6.5.+"
// Google Play Game services
//compile "com.google.android.gms:play-services-games:6.5.+"
// Google Wallet
//compile "com.google.android.gms:play-services-wallet:6.5.+"
// Android Wear
//compile "com.google.android.gms:play-services-wearable:6.5.+"
// Google Actions
// Google Analytics
// Google Cloud Messaging
//compile "com.google.android.gms:play-services-base:6.5.+"
15 Mar 2015 It is much easier (finally, sigh) to setup Facebook SDK dependency via maven central dependency than local library dependency.
dependencies {
compile 'com.facebook.android:facebook-android-sdk:3.23.1'
}
If you feel adventurous, you can wildcard the version number (which is in general not recommended to avoid unexpected build results)
but, it can be either one of these:
'com.facebook.android:facebook-android-sdk:3.23.+'
will pull any patch update
'com.facebook.android:facebook-android-sdk:3.2+'
will pull any minor update smaller than 30
or if you feel especially adventurous then even:
'com.facebook.android:facebook-android-sdk:3.+'
which will pull any update up to major being 4
15 Mar 2015 OSX 10.10
sudo discoveryutil udnsflushcaches
OSX 10.9
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
OSX 10.7 – 10.8
sudo killall -HUP mDNSResponder
OSX 10.5 – 10.6
sudo dscacheutil -flushcache
Windows
ipconfig /flushdns
Linux (depending on what you’re running for DNS resolver)
/etc/init.d/named restart
/etc/init.d/nscd restart
07 Mar 2015 First I needed to redirect my old /YYYY/MM/TITLE
structure to the new structure without any date prefix. Jekyll by default will let you do that easily with permalink: /:title
. But that does not solve the problem of having inbound links redirect to the right place on the new blog. It is pretty easy to solve with the redirect_from “native” jekyll plugin. The only thing that remains now is to add the redirect_from:/old_uri_with_date
to each new post.
For that I whipped the following short ruby script and to run over all the files I just used some bash.
for f in *; do ruby process.rb $f; done
Where process.rb
is:
ARGV.each do |a|
if (a[/^\d+/])
puts a
text = File.read(a)
new_contents = text.gsub(/^redirect_from:(.*)/, "redirect_from: #{$1}#{a}")
# To merely print the contents of the file, use:
puts new_contents
# To write changes to the file, use:
File.open(a, "w") {|file| file.puts new_contents }
end
end
That gets us about 80% of the transition covered. If you heavily customized your WP content with various plugins to pull this may create issues because the imported would probably not be able to convert them in an intelligent way.
The things that still remained for me were
So…
- For images I moved all the images to the
/media
folder and used regex magic to update the paths. - For code blocks I also used some regex magic.
Sublime Editor made it very easy to test and apply the regex. Using Git to track the changes and revert if I blew it proved useful too.
Below you can find some of the regex I used:
S: ^redirect_from: (\d+)-(\d+)-(\d+)-(.*).md$
R: redirect_from: /$1/$2/$4/
S: <pre>([\s\S]*?)\[cc lang="(.*?)"(.*)\]
(greedy match)
R: \n
``$3\n`
S: \[cc lang="(.*?)" (.*)"\]
R: \n
``$1\n`
S: \[/cc\]([\s\S]*?)</pre>
R: \n
``\n`
07 Mar 2015 ####Problem The redirect was not working. It was forcing a file download but was not redirecting the page. Turns out Jekyll does not correctly parse the case where the redirect_from
####Solution You need to add a trailing slat to the redirect_from:URL
i.e. redirect_from: /old_slug/
not redirect_from: /old_slug
. Note the trailing slash. This is how it is supposed to be done.
05 Mar 2015 I had a weird Java error appear after updating to Fabric. It turned out the problem was - I forgot to remove the crashlytics.jar
from the libs folder and there were still a few libraries there and the whole folder was getting compiled so when Fabric got added through aarr
file, I ended up with 2 copies of the library, which created the problem.
The initialization for Fabric is a little different now too.
Fabric.with(this, new Crashlytics(), new Twitter(authConfig), new MoPub());
or
Fabric.with(this, new Crashlytics());
if you only use Crashlytics