Skip to content

Instantly share code, notes, and snippets.

View IlyaEremin's full-sized avatar
🤡
SEVERE RECTAL PAIN

Ilia Eremin IlyaEremin

🤡
SEVERE RECTAL PAIN
  • Popuga Inc
  • Georgia
View GitHub Profile
@IlyaEremin
IlyaEremin / app_version.gradle
Last active August 2, 2023 15:59
Npm version for gradle
def getVersionName = { getVersionProps()['appVersionName'] }
def getVersionProps() {
def versionPropsFile = file('gradle.properties')
if (!versionPropsFile.exists()) {
versionPropsFile.createNewFile()
}
def versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
return versionProps
@IlyaEremin
IlyaEremin / build.gradle
Created February 18, 2017 20:34
Example of managing dependencies in separate file
apply from: 'deps.gradle'
// ...
dependencies {
compile supportLibs
compile rxJavaLibs
compile retrofitLibs
compile okHttpLibs
@IlyaEremin
IlyaEremin / big.json
Created March 5, 2017 13:14
Json for experiments
This file has been truncated, but you can view the full file.
[
{
"_id": "58acbe62d2cc022efd9f1d32",
"index": 0,
"guid": "d6fffee6-9f05-43e0-83fa-7b5f27ac7e95",
"isActive": true,
"balance": "$2,360.24",
"picture": "http://placehold.it/32x32",
"age": 34,
"eyeColor": "green",
@IlyaEremin
IlyaEremin / MySearchBox.java
Last active May 5, 2016 16:05
SearchBox back button bugfix
import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import com.quinny898.library.persistentsearch.SearchBox;
/**
@IlyaEremin
IlyaEremin / PushText.php
Created April 21, 2016 13:12
Push notification test code
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR_SERVER_API_KEY' );
$registrationIds = array("YOUR_DEVICE_TOKEN");
// prep the bundle
$msg = array
(
@IlyaEremin
IlyaEremin / HelloIlyaController.java
Created April 10, 2016 09:26
Spring mvc example
package controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Map;
/**
* Created by user on 06.04.2016.
@IlyaEremin
IlyaEremin / gist:6863385
Created October 7, 2013 06:36
BasketListAdapter
package com.melikovivan.yummy;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@IlyaEremin
IlyaEremin / quotes
Created June 27, 2013 14:11
4Dilya
<?xml version="1.0" encoding="UTF-8"?>
<quotes>
<quote>
<id>1</id>
<authorName>Н. Фоменко</authorName>
<text>порой мне кажется, что я
делаю какое-то дерьмо,
но когда я вижу, что делают
другие, то я чувствую себя
гением</text>
<?xml version="1.0" encoding="UTF-8"?>
<quotes>
<quote>
<authorName>Н. Фоменко</authorName>
<text>порой мне кажется, что я
делаю какое-то дерьмо,
но когда я вижу, что делают
другие, то я чувствую себя
гением</text>
</quote>
@IlyaEremin
IlyaEremin / gist:4240483
Created December 8, 2012 14:37
2 Polina
if (rect.Contains(Position)) // position - это координаты подростка
{
if (Position.Y < (rect.y + rect.height) && Math.Abs(Position.X -rect.x) < 30)
Velocity.X *= -1;
else if (Position.X > rect.x && Math.Abs(Position.Y - (rect.y + rect.height)) < 30)
Velocity.Y *= -1;
}