Skip to content

Instantly share code, notes, and snippets.

@ogero
ogero / ScrollTrackingListView.java
Last active August 29, 2015 14:17
A ListView that informs when and how much its content is scrolled.
/*
* 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
<!doctype html>
<html>
<head>
<style>
a.launch{
display: block;
text-align: center;
}
</style>
</head>
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 March 31, 2017 08:38
Change modified/created times of paths and files of Kodi library based on Movie release date, for correct order display.
package main
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"log"
"fmt"
"os"
"time"
"io/ioutil"
@ogero
ogero / Analytics.java
Created May 5, 2017 18:42
Analytics Android helper singleton
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 August 3, 2017 14:24
Toggle Hyper-V util (docker vs avd-haxm)
@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
@ogero
ogero / ExportableGridBehavior.php
Created September 4, 2017 19:53
Export grid to csv
<?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 December 2, 2018 22:22
Let's Encrypt Certbot util script for auto registration and renewal of ssl certs
#!/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 January 4, 2019 19:48
Install webhook as upstart service

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

---
# 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