Skip to content

Instantly share code, notes, and snippets.

//
// Copyright © 2018 Essential Developer. All rights reserved.
//
import UIKit
/*
The Singleton design pattern is intended to enforce
a class has only one instance.
@ldt25290
ldt25290 / CustomSpinner
Created August 17, 2018 11:41 — forked from medhdj/CustomSpinner
A custom Spinner with opened and closed event, you can use it to perform some UI changes on the Spinner for example
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Spinner;
public class CustomSpinner extends Spinner {
// private static final String TAG = "CustomSpinner";
private OnSpinnerEventsListener mListener;
private boolean mOpenInitiated = false;
@ldt25290
ldt25290 / gist:5b123b609cd5763096dcd3ee23c3abd8
Created November 10, 2016 18:36 — forked from boujeepossum/gist:4217737
MongoDB M101 HW Week 5
// HW 5.1
db.posts.aggregate([
{$project: {_id: 0,'comments.author':1}},
{$unwind: '$comments'},
{$group: {_id: '$comments.author', n: {$sum: 1}}},
{$sort: {n: -1}},
{$limit: 1}
])