Skip to content

Instantly share code, notes, and snippets.

@ogero
ogero / ScrollTrackingListView.java
Last active Aug 29, 2015
A ListView that informs when and how much its content is scrolled.
View ScrollTrackingListView.java
/*
* Copyright 2015 Gerónimo Oñativia
*
* 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
View LaunchAppPlayStoreFallback.html
<!doctype html>
<html>
<head>
<style>
a.launch{
display: block;
text-align: center;
}
</style>
</head>
View Joda-patternForStyle.txt
Locale: es_US === Style: SS === Pattern: M/d/yy h:mm a === Result: 1/31/17 12:55 AM
Locale: es_US === Style: MM === Pattern: MMM d, y h:mm:ss a === Result: ene 31, 2017 12:55:51 AM
Locale: es_US === Style: LL === Pattern: d 'de' MMMM 'de' y h:mm:ss a z === Result: 31 de enero de 2017 12:55:51 AM GMT-03:00
Locale: es_US === Style: FF === Pattern: EEEE, d 'de' MMMM 'de' y h:mm:ss a zzzz === Result: martes, 31 de enero de 2017 12:55:51 AM Hora estándar de Argentina
Locale: es_AR === Style: SS === Pattern: dd/MM/yy HH:mm === Result: 31/01/17 00:55
Locale: es_AR === Style: MM === Pattern: dd/MM/y HH:mm:ss === Result: 31/01/2017 00:55:51
Locale: es_AR === Style: LL === Pattern: d 'de' MMMM 'de' y H:mm:ss z === Result: 31 de enero de 2017 0:55:51 ART
Locale: es_AR === Style: FF === Pattern: EEEE, d 'de' MMMM 'de' y HH'h'''mm:ss zzzz === Result: martes, 31 de enero d
@ogero
ogero / main.go
Created Mar 31, 2017
Change modified/created times of paths and files of Kodi library based on Movie release date, for correct order display.
View main.go
package main
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"log"
"fmt"
"os"
"time"
"io/ioutil"
@ogero
ogero / Analytics.java
Created May 5, 2017
Analytics Android helper singleton
View Analytics.java
import android.app.Application;
import android.os.Handler;
import android.util.Log;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.HitBuilders;
import com.google.android.gms.analytics.Tracker;
import java.util.HashMap;
import java.util.Iterator;
@ogero
ogero / HyperVToggle.bat
Created Aug 3, 2017
Toggle Hyper-V util (docker vs avd-haxm)
View HyperVToggle.bat
@echo off
:InputToggle
echo Select hypervisor launch tipe (auto/off):(A/O)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="a" goto auto
If /I "%INPUT%"=="o" goto off
echo Incorrect input & goto InputToggle
View ExportableGridBehavior.php
<?php
/**
* GridView Export Behavior
* Requirements:
* Yii 1.1.3 or greater
* An explicit rule on the action that exports the csv like: '<controller:\w+>/<action:\w+>' => '<controller>/<action>'
* Usage:
* <pre>
* //(Step 1) Add this behavior to the controller like
@ogero
ogero / certbot-util.sh
Last active Dec 2, 2018
Let's Encrypt Certbot util script for auto registration and renewal of ssl certs
View certbot-util.sh
#!/bin/bash
# ######################################################################################## #
# LET'S ENCRYPT CERTBOT UTIL SCRIPT FOR AUTO REGISTRATION AND RENEWAL #
# AUTHOR: GERÓNIMO OÑATIVIA <geronimox@gmail.com> #
# VERSION: 1.0.0 #
# REQUIREMENTS:
# - CERTBOT (https://certbot.eff.org/) #
# ######################################################################################## #
@ogero
ogero / README.MD
Last active Jan 4, 2019
Install webhook as upstart service
View README.MD

Webhook basic configuration for Bitbucket

Webhook basic configuration for Bitbucket.

Getting Started

These instructions will get you a clean daemonized webhook installation, ready to execute gulp deploy when bitbucket receives a push on a certain branch.

Installing

View hydra.yaml
---
# Source: hydra/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-hydra
labels:
app.kubernetes.io/name: hydra
app.kubernetes.io/instance: release-name
app.kubernetes.io/managed-by: Tiller