get uri from filechooser picker
content://com.android.providers.downloads.documents/document/2303
con getRealPath(context,uri) se obtiene la ruta absoluta
file:///storage/emulated/0/Download/google-play-badge.png
get uri from filechooser picker
content://com.android.providers.downloads.documents/document/2303
con getRealPath(context,uri) se obtiene la ruta absoluta
file:///storage/emulated/0/Download/google-play-badge.png
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
| // From - http://stackoverflow.com/a/32724422/906577 | |
| ... | |
| final CollapsingToolbarLayout collapsingToolbar = | |
| (CollapsingToolbarLayout) mRootView.findViewById(R.id.collapsing_toolbar); | |
| AppBarLayout appBarLayout = (AppBarLayout) mRootView.findViewById(R.id.appbar); | |
| appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { | |
| boolean isShow = false; | |
| int scrollRange = -1; |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.support.v4.app.Fragment; | |
| import android.support.v4.app.FragmentManager; | |
| import android.support.v4.app.FragmentPagerAdapter; | |
| public class MyFragmentPageAdapter extends FragmentPagerAdapter { |
| def render_to_response(self, context, **response_kwargs): | |
| from django.conf import settings | |
| STATIC_URL = settings.STATIC_URL | |
| if 'http' not in STATIC_URL: | |
| # wkhtmltopdf requires full uri to load css | |
| from urlparse import urlparse | |
| parsed = urlparse(self.request.META.get('HTTP_REFERER')) | |
| parsed = '{uri.scheme}://{uri.netloc}'.format(uri=parsed) | |
| context["STATIC_URL"] = "{}{}".format(parsed, settings.STATIC_URL) |
| <?php | |
| $query = new EntityFieldQuery(); | |
| $query->entityCondition('entity_type', 'node') | |
| ->entityCondition('bundle', 'article') | |
| ->propertyCondition('status', 1) | |
| ->fieldCondition('field_image', 'fid', 'NULL', '!=') | |
| ->range(0, 1); | |
| $result = $query->execute(); | |
| if (isset($result['node'])) { |
| def find(key, dictionary): | |
| for k, v in dictionary.iteritems(): | |
| if k == key: | |
| yield v | |
| elif isinstance(v, dict): | |
| for result in find(key, v): | |
| yield result | |
| elif isinstance(v, list): | |
| for d in v: | |
| for result in find(key, d): |
| """ | |
| jQuery templates use constructs like: | |
| {{if condition}} print something{{/if}} | |
| This, of course, completely screws up Django templates, | |
| because Django thinks {{ and }} mean something. | |
| Wrap {% verbatim %} and {% endverbatim %} around those | |
| blocks of jQuery templates and this will try its best |