Skip to content

Instantly share code, notes, and snippets.

Thiago Filadelfo trfiladelfo

Block or report user

Report or block trfiladelfo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
trfiladelfo / Date.prototype.diff.js
Created Sep 2, 2019 — forked from netojoaobatista/Date.prototype.diff.js
Returns the difference between two Date objects.
View Date.prototype.diff.js
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) {
trfiladelfo /
Created Aug 29, 2019 — forked from joshdholtz/
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
trfiladelfo /
Created Aug 29, 2019
simulate click android
view.setOnTouchListener(new OnTouchListener()
public boolean onTouch(View v, MotionEvent event)
Toast toast = Toast.makeText(
"View touched",
public class NonSwipeableViewPager extends ViewPager {
public NonSwipeableViewPager(Context context) {
public NonSwipeableViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
trfiladelfo /
Created Jul 6, 2019
install postman in linux mint

When it comes to API development, my weapon of choice for testing my code is Postman. I start using Postman since it's still a Chrome App. Now it encourages its user to use Postman Native app. I definitely love the idea, but all I can find is a download link without any installation document for Linux Mint.

So, here's what I did:

Download postman
$ wget -O postman.tar.gz

Extract archive
$ sudo tar -xzf postman.tar.gz -C /opt
trfiladelfo /
Last active May 29, 2019 — forked from sethbergman/
Install Docker CE on Linux Mint 19 / Ubuntu
#!/usr/bin/env bash
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] bionic stable"
sudo apt-get update
sudo apt-get install
View UIImage+Resize.swift
// UIImage+Resize.swift
// Created by Marcos Griselli on 6/9/17.
// Copyright © 2017 Marcos Griselli. All rights reserved.
import Foundation
import UIKit
trfiladelfo / multipart.swift
Created Mar 12, 2019 — forked from DejanEnspyra/multipart.swift
Alamofire 4 — Multipart file upload with Swift 3 (
View multipart.swift
func requestWith(endUrl: String, imageData: Data?, parameters: [String : Any], onCompletion: ((JSON?) -> Void)? = nil, onError: ((Error?) -> Void)? = nil){
let url = "" /* 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
trfiladelfo / RecyclerViewExtension.kt
Created Mar 5, 2019 — forked from arcadefire/RecyclerViewExtension.kt
Add addOnItemClickListener easily to a RecyclerView using Kotlin
View RecyclerViewExtension.kt
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?) {
trfiladelfo / [1] main.js
Created Nov 3, 2018 — forked from hfalucas/[1] main.js
[Vue.js] Authentication and Authorization
View [1] main.js
* 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'
You can’t perform that action at this time.