Skip to content

Instantly share code, notes, and snippets.

/*
*
* Given a string S, return the “reversed” string where all characters that are not a letter stay in the same place,
* and all letters reverse their positions.
*
* Example 1:
* Input: “ab-cd”
* Output: “dc-ba”
*
* Example 2:
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.graphics.*
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
class BarcodeView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
@Ronelg
Ronelg / gstreamer_cerbero_android.md
Created December 28, 2018 21:45 — forked from wonchulee/gstreamer_cerbero_android.md
how to build GStreamer cerbero for Android

How to build GStreamer cerbero for Android

###Clone and build cerbero

clone cerbero from gstreamer, not sdk/gstreamer

git clone git://anongit.freedesktop.org/gstreamer/cerbero

build cerbero for getting gstreamer-1.0-android-armv7-<version>.zip

@Ronelg
Ronelg / Node_AWS_Linux.md
Created January 11, 2018 20:29 — forked from nrollr/Node_AWS_Linux.md
Install Node.js on Amazon Linux (EC2)

Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
@Ronelg
Ronelg / rxjs_operators_by_example.md
Created September 24, 2016 20:01 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
/*
* Copyright (C) 2011 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
@Ronelg
Ronelg / AppLifeCycle.java
Created January 30, 2016 09:17
Android application foreground or bakcground
/**
* Check if the application is in the foreground or background.
* *
* Register this callbacks for an application
* Application application = (Application) context.getApplicationContext();
* application.registerActivityLifecycleCallbacks(new BaseLifeCycleCallbacks());
* *
* Note: These callbacks can be registered at any level of the application lifecycle.
* Previous methods to get the application lifecycle forced the lifecycle callbacks to be registered