Skip to content

Instantly share code, notes, and snippets.

import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Checkable;
import android.widget.ImageButton;
public class ToggleImageButton extends ImageButton implements Checkable {
@Astyk
Astyk / time.js
Created November 14, 2014 14:41
Time tags humanization in HTML
/**
* Time.js — time tags humanization in HTML documents.
*
* @date 2013-12-30
* @time 00:05
* @author MaximAL
* @link https://github.com/maximal/time.js
* @copyright © MaximAL 2013
*/
var timejs = {
package com.az.custom.request;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
@Astyk
Astyk / JsonApiConverter.java
Created April 15, 2016 15:25 — forked from Gregadeaux/JsonApiConverter.java
JSONAPI Converter for RetroFit with RxJava and RetroLambda
package ai.cometandroid.network;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.internal.LinkedHashTreeMap;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
/*
* Copyright 2016. Dmitry Malkovich
*
* 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
@Astyk
Astyk / AccountAuthenticator.java
Created August 15, 2016 09:55 — forked from burgalon/AccountAuthenticator.java
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
@servers(['staging' => '[email protected]', 'production' => '[email protected]'])
<?php
$app_name = 'l5eka';
$app_path = '/var/www/vhosts/'.$app_name;
$repo = 'https://github.com/vedovelli/l5eka';
$branch = 'aula4';
$keep = 6;
$timezone = 'America/Sao_Paulo';
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
@Astyk
Astyk / Envoy.blade.php
Created October 10, 2016 10:35
Laravel Envoy Task Runner
@servers(['staging' => '[email protected]', 'production' => '[email protected]'])
<?php
$app_name = 'l5eka';
$app_path = '/var/www/vhosts/'.$app_name;
$repo = 'https://github.com/vedovelli/l5eka';
$branch = 'aula4';
$github_token = ''; // GitHub OAuth token
$server_name = '192.168.0.99'; // IP ou domínio válido. Usado no nginx