Skip to content

Instantly share code, notes, and snippets.

View jido2015's full-sized avatar

Bashorun Olajide John jido2015

View GitHub Profile
@jido2015
jido2015 / README.MD
Created April 28, 2021 19:25 — forked from gabrielemariotti/README.MD
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@jido2015
jido2015 / EventBus.kt
Created March 9, 2021 23:48 — forked from takahirom/EventBus.kt
EventBus by Kotlin coroutine
import kotlinx.coroutines.experimental.channels.BroadcastChannel
import kotlinx.coroutines.experimental.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.filter
import kotlinx.coroutines.experimental.channels.map
import kotlinx.coroutines.experimental.launch
import javax.inject.Inject
import javax.inject.Singleton
@jido2015
jido2015 / GlobalSocketWithEventBus.java
Last active November 2, 2019 12:19
Service to emit and listen to server response every 5 seconds
public class GlobalSocketWithEventBus extends Service {
NetworkStateChange networkStateChange;
Socket socket;
Socket socket2;
String token;
GPSTracker gpsTracker;
SharedPreferences prefToken;
SharedPreferences prefUser;
Handler handler = new Handler();
@jido2015
jido2015 / rails_new_help_output.md
Created January 17, 2019 11:58 — forked from eliotsykes/rails_new_help_output.md
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@jido2015
jido2015 / recoginze.js
Created August 24, 2018 10:03
We have a characterScript function and a way to correctly loop over charac- ters. The next step is to count the characters that belong to each script. The following counting abstraction will be useful there:
function countBy(items, groupName) {
let counts = [];
for (let item of items) {
let name = groupName(item);
let known = counts.findIndex(c => c.name == name);
console.log(name);
if (known == -1) {
counts.push({name, count: 1});
} else {