As configured in my dotfiles.
start new:
tmux
start new with session name:
#import <Foundation/Foundation.h> | |
@interface Communicator : NSObject <NSStreamDelegate> { | |
@public | |
NSString *host; | |
int port; | |
} | |
- (void)setup; |
public abstract class BaseAdapter<T, VH extends BaseViewHolder<T>> extends RecyclerView.Adapter<VH> { | |
private List<T> items; | |
// Missing: setItems(), addItem(), removeItem(), ... | |
@Override | |
public final void onBindViewHolder(VH vh, int position) { | |
T item = items.get(position); | |
vh.performBind(item, position); |
public abstract class BaseAdapter<T, VH extends BaseViewHolder<T>> extends RecyclerView.Adapter<VH> { | |
private List<T> items; | |
// Missing: setItems(), addItem(), removeItem(), ... | |
@Override | |
public final void onBindViewHolder(VH vh, int position) { | |
T item = items.get(position); | |
vh.performBind(item, position); |
public class ReactiveTextViewHolder<T> extends ReactiveViewHolder<T> { | |
private TextView label; | |
private T currentItem; | |
public ReactiveTextViewHolder(View itemView) { | |
super(itemView); | |
label = (TextView) itemView.findViewById(android.R.id.text1); | |
} |
/** | |
* Created by Ishank Gulati on 14/10/16. | |
* Observer as per Observer design pattern. | |
*/ | |
public interface RVObserver { | |
void update(RecyclerViewItemClickListener listener); | |
} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
/* | |
I find myself recreating user models for Mongoose every time I start a new project, so I thought I'd create a generic schema for a user model that can be added to or modified as need be. | |
This is loosely based on the Meteor user model (using a "profile" sub-object for the user's personal information). It also includes an optional geolocation point for the user, and Mongoose timestamps, as well as a pre("save") function to bcrypt the user password and a comparePassword() function. | |
Just save this file wherever you store your models and do something like const Users = include('./models/userSchema.js') and you can just use it as a standard Mongoose user model. | |
The username/email address definitions were copied from this tutorial: https://thinkster.io/tutorials/node-json-api/creating-the-user-model |