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 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| /** | |
| * Created by Ishank Gulati on 14/10/16. | |
| * Observer as per Observer design pattern. | |
| */ | |
| public interface RVObserver { | |
| void update(RecyclerViewItemClickListener listener); | |
| } |
| 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); | |
| } |
| 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); |
| #import <Foundation/Foundation.h> | |
| @interface Communicator : NSObject <NSStreamDelegate> { | |
| @public | |
| NSString *host; | |
| int port; | |
| } | |
| - (void)setup; |
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
| <!-- Application theme. --> | |
| <style name="MyTheme" parent="@android:style/Theme.Holo"> | |
| <item name="android:windowActionBarOverlay">true</item> | |
| <item name="android:actionBarStyle">@style/MyTheme.ActionBar</item> | |
| <item name="android:windowContentOverlay">@null</item> | |
| <item name="android:windowBackground">@color/red_background</item> | |
| </style> | |
| <style name="MyTheme.ActionBar" parent="android:Widget.Holo.ActionBar"> | |
| <item name="android:background">@android:color/transparent</item> | |
| <item name="android:backgroundStacked">@android:color/transparent</item> |
| public class SomeFragment extends Fragment { | |
| MapView mapView; | |
| GoogleMap map; | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
| View v = inflater.inflate(R.layout.some_layout, container, false); | |