Skip to content

Instantly share code, notes, and snippets.

View sergenes's full-sized avatar
🏠
Working from home

Sergey Neskoromny sergenes

🏠
Working from home
View GitHub Profile
enum class RowType {
TOP, MIDDLE, BOTTOM, SINGLE
}
@Composable
fun HomeListItem(
title: String,
subTitle: String,
type: RowType,
editMode: Boolean = false,
@sergenes
sergenes / PhonecallReceiver.java
Created November 2, 2018 14:52 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@sergenes
sergenes / apps.html
Last active October 19, 2018 13:03
My Apps
AirSync
iOS - https://itunes.apple.com/us/app/airsync-for-apple-stickies/id554182458?mt=8
MacOS - https://itunes.apple.com/us/app/airsync-for-apple-stickies/id543513150?mt=12
Android - https://play.google.com/store/apps/details?id=com.umnes.stickies2go
PhotoDj
Web - https://photodj.me
iOS - https://itunes.apple.com/us/app/photodj-zoom-your-photos-in/id1325400635?mt=8
Android - https://play.google.com/store/apps/details?id=com.nes.pdj.photodj
class Node<T>(var data: T, var nextNode: Node<T>? = null)
class LinkedList<T> {
var size: Int = 0
var head: Node<T>? = null
//O(1)
fun insertStart(data: T) {
size += 1
val newNode = Node(data = data)
@sergenes
sergenes / bluetooth-raspberry-pi-communication.py
Created August 27, 2018 13:46 — forked from keithweaver/bluetooth-raspberry-pi-communication.py
Sending information with bluetooth on Raspberry Pi (Python)
# Uses Bluez for Linux
#
# sudo apt-get install bluez python-bluez
#
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html
import bluetooth
def receiveMessages():
@sergenes
sergenes / nodejs-tcp-example.js
Created August 13, 2016 02:06 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@sergenes
sergenes / gist:9ebee9d91c75b5cde7d7
Created March 9, 2016 07:52
Android - Fragment - show/hide keyboard event and move up the main layout
Rect visibleRect = new Rect();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup mMain = (ViewGroup) inflater.inflate(R.layout.select_cover_album, container, false);
mMain.getWindowVisibleDisplayFrame(visibleRect);
mMain.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
1. Building Scalable Stateless Applications with RxJava Rick Warren | Principal Engineer, eHarmony [email protected] | @DangerLemming
2. RxJava • Encapsulates data sequences: Observable • Provides composable operations on them • Abstracts away threading and synch • Port from Microsoft .NET Reactive Extensions • Java 6+, Groovy, Clojure, JRuby, Kotlin, and Scala; Android-compatible
3. Netflix Client Client Client Client Client Coarse-Grained API Orchestration Layer Mi- -cro Ser- -vic- -es
4. Applicability Application or Presentation-Layer Service Client Client Client Client Client Data Source Data Source Data Source Data Source Data Source
5. 3 Problems 1. Streaming queries 2. Rate-limited APIs (with retries) 3. Using Futures
6. Streaming Queries Data Store Service Client 1 2 3 1. Query lots of data from NoSQL store 2. Enrich, filter, and score on the fly 3. Deliver “best” results to client
7. Streaming Queries 1 Query 2 Enrich 3 Deliver + = Too Much Latency
8. Streaming Queries 1 Query && = 2 Enrich 3 Deli
"Android development War Stories"
1. Android Development War Stories by Lope Emano April-June 2014
2. Seriously though.
3. The Format Share and discuss experiences in an app you’ve built and/or the new things you’ve learned the past few months.
4. Things I’ve learned the past few months
5. New Design-First process is kewl First two weeks: ❖ Researched existing similar apps (advantages and disadvantages) ❖ Watched Android Design In Action videos ❖ Sketched designs/layouts using pencil and paper via printed out stencil kit
6. New Design-First process is kewl ❖ Demo app to product owner in front of photoshop for insta changes ❖ Acquaint designer with terms like "actionbar, navigation bar, status bar, overflow" for easy communication ❖ Android asset studio ❖ Look around for potential tools
7. Libraries
8. Guava - Light and useful - Used only MultiMap and StringUtils - Still have a lot to learn!
9. No need for ActionBarSherlock - Android support library can now suffice
@sergenes
sergenes / gist:3e8cf67b771c9bca3b5d
Created August 5, 2014 06:40
Reset Storyboard to Initial View Controller
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
_initalStoryboard = self.window.rootViewController.storyboard;
}
-(void) resetStoryBoard{