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
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file. | |
set the background of a view to card, | |
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view | |
``` xml | |
<View | |
android:layout_width="fill_parent" |
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"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle" > | |
<gradient | |
android:angle="-90" | |
android:startColor="#00000000" | |
android:centerColor="#00000000" | |
android:endColor="#4d000000" | |
android:type="linear" /> | |
</shape> |
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 (C) 2017 The Android Open Source Project | |
* | |
* 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
// Regex function that return a list of items split by the pattern. | |
public List<String> getTokens(String pattern) | |
{ | |
ArrayList<String> tokens = new ArrayList<String>(); | |
Pattern tokSplitter = Pattern.compile(pattern); | |
Matcher m = tokSplitter.matcher(text); | |
while (m.find()) { | |
tokens.add(m.group()); | |
} |
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
/*! | |
* By Eharry.me (https://gist.github.com/Ema4rl/b8ef90be99205ddada5ef2cd6e632ebe) | |
*/ | |
! function ($) { | |
"use strict"; | |
var slide = $("[data-slides]"), | |
count = 0, | |
slides = slide.data("slides"), | |
len = slides.length, | |
n = function () { |
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
$(document).ready(function() { | |
//array | |
var books = ["Pride and Prejudice", "Running with Scissors", "The DaVinci Code", "The Aeneid"]; | |
// element tag from html and using array as source | |
$("#tags").autocomplete({source: books}); | |
}); |
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 sys | |
import operator | |
import requests | |
import json | |
import twitter | |
from config import * | |
# Interact with Twitter API | |
twitter_api = twitter.Api(consumer_key = twitter_consumer_key, consumer_secret = twitter_consumer_secret, |
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
var express = require('express'); | |
var morgan = require('morgan'); | |
var hostname = 'localhost'; | |
var port = 3000; | |
var app = express(); | |
app.use(morgan('dev')); | |
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
<span class="reading-time" title="Estimated read time"> | |
{% assign words = content | number_of_words %} | |
{% if words == 180 %} | |
1 minute read | |
{% elsif words < 180 %} | |
less than 1 minute read | |
{% else %} | |
{{ words | plus:90 | divided_by:180 }} minutes read | |
{% endif %} | |
</span> |
NewerOlder