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
View NonSwipeableViewPager.java
public class NonSwipeableViewPager extends ViewPager {
public NonSwipeableViewPager(Context context) {
super(context);
}
public NonSwipeableViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@trfiladelfo
trfiladelfo / script.md
Created Jul 6, 2019
install postman in linux mint
View script.md

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 https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

Extract archive
$ sudo tar -xzf postman.tar.gz -C /opt
@trfiladelfo
trfiladelfo / install-docker.sh
Last active May 29, 2019 — forked from sethbergman/install-docker.sh
Install Docker CE on Linux Mint 19 / Ubuntu
View install-docker.sh
#!/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/
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
trfiladelfo / multipart.swift
Created Mar 12, 2019 — forked from DejanEnspyra/multipart.swift
Alamofire 4 — Multipart file upload with Swift 3 (http://theappspace.com/multipart-file-upload/)
View multipart.swift
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
@trfiladelfo
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.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?) {
@trfiladelfo
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'
@trfiladelfo
trfiladelfo / MaskWatcher.kt
Created Aug 14, 2018
Apply masks in Kotlin
View MaskWatcher.kt
/**
* Realiza a formatação instânea na caixa de texto conforme o formato pré-definido.
*
* Forma de uso:
* <code>
* textview_phone.let {
* it.addTextChangedListener(Tools.MaskWatcher(Tools.MaskWatcher.Format.MOBILE_PHONE))
* }
* </code>
* @param formats padrão para aplicar a máscara.
@trfiladelfo
trfiladelfo / MaskWatcher.java
Created Aug 10, 2018 — forked from diegoy/MaskWatcher.java
Apply masks to Android's Edit text adding this TextWatcher
View MaskWatcher.java
/*
MIT License
Copyright (c) 2016 Diego Yasuhiko Kurisaki
*/
/* Example:
mEmailView.addTextChangedListener(new MaskWatcher("###-##"));
*/
import android.text.Editable;
@trfiladelfo
trfiladelfo / Decrypter.java
Created Jul 20, 2018 — forked from scotttam/Decrypter.java
encrypt and decrypt with PBKDF2/SHA1 and AES
View Decrypter.java
import javax.crypto.Cipher;
import java.security.spec.KeySpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.SecretKeyFactory;
import java.security.AlgorithmParameters;
import javax.crypto.spec.IvParameterSpec;
public class Decrypter {
You can’t perform that action at this time.