This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| MIT License | |
| Copyright (c) 2016 Diego Yasuhiko Kurisaki | |
| */ | |
| /* Example: | |
| mEmailView.addTextChangedListener(new MaskWatcher("###-##")); | |
| */ | |
| import android.text.Editable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Think of this "main.js" file as your application bootstrap. | |
| */ | |
| import Vue from 'vue' | |
| import Resource from 'vue-resource' | |
| import VueRouter from 'vue-router' | |
| import routes from './routes' | |
| import middleware from './middleware' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v7.widget.RecyclerView | |
| import android.view.View | |
| interface OnItemClickListener { | |
| fun onItemClicked(position: Int, view: View) | |
| } | |
| fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) { | |
| this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener { | |
| override fun onChildViewDetachedFromWindow(view: View?) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func requestWith(endUrl: String, imageData: Data?, parameters: [String : Any], onCompletion: ((JSON?) -> Void)? = nil, onError: ((Error?) -> Void)? = nil){ | |
| let url = "http://google.com" /* your API url */ | |
| let headers: HTTPHeaders = [ | |
| /* "Authorization": "your_access_token", in case you need authorization header */ | |
| "Content-type": "multipart/form-data" | |
| ] | |
| Alamofire.upload(multipartFormData: { (multipartFormData) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIImage+Resize.swift | |
| // | |
| // Created by Marcos Griselli on 6/9/17. | |
| // Copyright © 2017 Marcos Griselli. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
| sudo apt-get update | |
| sudo apt-get install docker.io | |
| # https://docs.docker.com/compose/install/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NonSwipeableViewPager extends ViewPager { | |
| public NonSwipeableViewPager(Context context) { | |
| super(context); | |
| } | |
| public NonSwipeableViewPager(Context context, AttributeSet attrs) { | |
| super(context, attrs); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.defineProperty(Date.prototype,"diff",{ | |
| writable: false, configurable: false, enumerable: true, | |
| /** | |
| * Returns the difference between two Date objects. | |
| * @param {Date} The date to compare to. | |
| * @return {Object} | |
| * @throws {TypeError} | |
| */ | |
| value: function(date) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * immersiveMode | |
| * set onPostResume, onSystemUiVisibilityChange | |
| */ | |
| fun immersiveMode(activity: Activity) { | |
| activity.window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN) | |
| activity.window | |
| .setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |