Skip to content

Instantly share code, notes, and snippets.

$ php artisan cars:query --mpg=27.0 --cylinders=4 --origin=Japan
MPG:
18.0 - 17
15.0 - 16
16.0 - 13
17.0 - 7
14.0 - 19
0 - 8
24.0 - 11
@tral
tral / index_in_query.php
Last active June 27, 2016 02:46
Example backend implementation
<?php
header('Access-Control-Allow-Origin : *');
echo '[
{
"target":"upper_75",
"datapoints":[
[622,1450754160000],
[365,1450754220000]
// Баланс пользователя в Rch
Double userBalanceRch = Double.parseDouble(User.getBalanceRch(activity));
// Шаг вывода в валюте продавца, если не задан, берем 1
Double outStep = 1.0;
try {
outStep = Double.parseDouble(f_out_step);
} catch (Exception e) {
}
// Минимально возможный вывод в Rch, если не задан, то 0
Double minPossibleOutRch = 0.0;
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
@tral
tral / gist:8fb400fc22916dd62d51
Created January 23, 2015 16:47
TestActivity
package ru.perm.trubnikov.gps2sms;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
@tral
tral / gist:92a9e57e10e91db97e9f
Created January 9, 2015 05:39
Code for the "Rate app" button (To open its page in Google Play Store)
Intent int_rate = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id="
+ getApplicationContext().getPackageName()));
int_rate.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(int_rate);