Skip to content

Instantly share code, notes, and snippets.

View evasyuk's full-sized avatar

Yevhenii Vasiuk evasyuk

View GitHub Profile
@evasyuk
evasyuk / _.md
Last active August 29, 2015 14:17 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is written in BSD mandoc.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke. Same for the const correctness.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at least.
package de.greenrobot.util;
import java.util.concurrent.Executor;
import android.os.AsyncTask;
import android.os.Build;
/**
* Uses level 11 APIs when possible to use parallel/serial executors and falls back to standard execution if API level
* is below 11.
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.util.LruCache;
public class BitmapCache {
private static Context sAppContext;
@evasyuk
evasyuk / CircularArrayAdapter
Created June 29, 2015 17:35
CircularArrayAdapter
public class CircularArrayAdapter extends ArrayAdapter
{
public static final int HALF_MAX_VALUE = Integer.MAX_VALUE/2;
public final int MIDDLE;
private T[] objects;
public CircularArrayAdapter(Context context, int textViewResourceId, T[] objects)
{
super(context, textViewResourceId, objects);
scroll.setOnTouchListener(new OnTouchListener()
{
private int mLastY;
public boolean onTouch(View v, MotionEvent event)
{
switch (event.getAction())
{
case MotionEvent.ACTION_DOWN: //the user places his finger on the screen
mLastY=(int)event.getY(); //to get the "y" position starting
break;
@evasyuk
evasyuk / CircleTransform.java
Last active August 29, 2015 14:26 — forked from julianshen/CircleTransform.java
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
@evasyuk
evasyuk / Mulitiple_Items_Adapter.java
Created August 11, 2015 07:17
ListView with ITEM_TYPE_COUNT > 1
>>ArrayIndexOutOfBoundsException with custom Android Adapter for multiple views in ListView
Romain Guy said:
The item view type you are returning from
getItemViewType() is >= getViewTypeCount().
from http://stackoverflow.com/questions/2596547/arrayindexoutofboundsexception-with-custom-android-adapter-for-multiple-views-in
>>Creating ViewHolders for ListViews with different item layouts
@evasyuk
evasyuk / com.genyware.core.App.java
Created October 19, 2015 14:55
Android BUS pattern + utility gist
package com.genyware.core;
//missed
public class App extends Application implements Bus.Subscriber {
public static TManager tm;
private static App self;
public static App getInstance() {