Skip to content

Instantly share code, notes, and snippets.

View johncordeiro's full-sized avatar

John Cordeiro johncordeiro

View GitHub Profile
@johncordeiro
johncordeiro / trocadilhos.json
Created May 5, 2023 14:09 — forked from henrycunh/trocadilhos.json
Dataset com trocadilhos/charadas, extraídos do site https://osvigaristas.com.br
[
{
"pergunta" : "Quais heróis se preocupam mais com as poses para fotos do que com salvar o seu planeta?",
"resposta" : "Os TumblrCats"
},{
"pergunta" : "Qual é a profissão do Homem Aranha?",
"resposta" : "Desenvolvedor Web"
},{
"pergunta" : "Qual é o estado dos EUA que te eletrifica?",
"resposta" : "Ohio."
@johncordeiro
johncordeiro / README.md
Last active April 26, 2018 21:11 — forked from rbf/README.md
Script to recursively generate PDF files from markdown files in the current directory and its subfolders using "pandoc".

%process-md % https://gist.github.com/rbf/6064734

Description

process-md is a bash tool to recursively generate files from markdown files in other formats using pandoc, which is assumed installed. By default (i.e. calling command tool with no arguments) it processes all markdown files in the current directory and places the resulting PDF files in a ./target directory.

package br.com.ilhasoft.clickcondo.helpers
import br.com.ilhasoft.support.core.preferences.BasePreferences
import kotlin.reflect.KProperty
/**
* Created by john-mac on 11/23/16.
*/
class PreferenceFieldDelegate<T>(val defaultValue: T?) {
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@johncordeiro
johncordeiro / DateConversion.java
Created February 4, 2015 17:54
Date conversion
long currentTime = System.currentTimeMillis();
DateUtils.getRelativeTimeSpanString(currentTime - TimeUnit.MINUTES.toMillis(1)) // 1 minute ago
DateUtils.getRelativeTimeSpanString(currentTime - TimeUnit.MINUTES.toMillis(5)) // 5 minutes ago
DateUtils.getRelativeTimeSpanString(currentTime - TimeUnit.HOURS.toMillis(1)) // 1 hour ago
DateUtils.getRelativeTimeSpanString(currentTime - TimeUnit.HOURS.toMillis(12)) // 12 hours ago
DateUtils.getRelativeTimeSpanString(currentTime - TimeUnit.DAYS.toMillis(1)) // yesterday
@johncordeiro
johncordeiro / ParallaxPageTransformer.java
Last active September 10, 2015 05:50
PagerTransformer for Parallax views.
import android.support.v4.view.ViewPager;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
/**
* Parallax transformer for ViewPagers that let you set different parallax
* effects for each view in your Fragments.
*