Skip to content

Instantly share code, notes, and snippets.

@jromero
jromero / jquery.jplayerskin.js
Created November 10, 2010 11:26
Update for proper dynamic content functionality
/**
* jPlayerSkin - Class to handle with jplayer initialization and skin behavior
*
* @author BlackNRoll
* @update J.Romero
* @version 1.2 (Unofficial)
* @uses jQuery 1.4.2
* @uses jScrollPane
* @param array myPlayList = Array of json objects. Ex.: var myPlayList = [ {artist:"",name:"",mp3:"",cover:""} ];
* @param string container = The id of the container where the player will be build
@jromero
jromero / jquery.jplayerskin.js
Created November 10, 2010 11:34
Update for dynamic content to jplayerskin from blacknroll
/**
* jPlayerSkin - Class to handle with jplayer initialization and skin behavior
*
* @author BlackNRoll
* @update J.Romero
* @version 1.2 (Unofficial)
* @uses jQuery 1.4.2
* @uses jScrollPane
* @param array myPlayList = Array of json objects. Ex.: var myPlayList = [ {artist:"",name:"",mp3:"",cover:""} ];
* @param string container = The id of the container where the player will be build
@jromero
jromero / sybase
Created January 10, 2013 14:16
An init script for sybase for standard start, stop, restart, and status.
#!/bin/sh
#
# Startup script for Sybase ASE
#
# description: Sybase Adaptive Server Enterprise
# is a SQL database server.
# processname: dataserver
SYBASE=/opt/sybase
@jromero
jromero / RemoteFragment.java
Created July 28, 2013 18:01
Use a fragment from a separate package (app) while maintaining resources intact. (Not tested extensively, specially with themes). Note: The remote fragment should be self sufficient and wouldn't be able to interact with dependancies of the main application or vise-versa. [See http://stackoverflow.com/questions/10792136/classcastexception-while-d…
package com.example.api.extension;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@jromero
jromero / adb_db_pull.sh
Created February 11, 2014 17:16
Pull database from _debuggable_ Android application on device. (Credit to: http://stackoverflow.com/a/12914297/552902)
#!/bin/bash
REQUIRED_ARGS=2
PULL_DIR="./"
ADB_PATH=`which adb`
if [ $? -ne 0 ]
then
echo "Could not find adb!"
exit 1
fi;
@jromero
jromero / Parameterized Enum
Last active August 29, 2015 13:56
Example on how to use a parameterized Enum to maintain associated keys and values.
package com.github.unispeech.languageselect;
import com.rookery.web_api_translate.type.Language;
public enum SupportedSttLanguage {
ENGLISH_US("eng-AUS", "English", "US", Language.ENGLISH),
ENGLISH_UK("eng-GBR", "English", "UK", Language.ENGLISH),
ENGLISH_AUS("eng-USA", "English", "Australia", Language.ENGLISH),
ARABIC_EGYPT("ara-EGY", "Arabic", "Egypt", Language.ARABIC),
ARABIC_SAUDI("ara-SAU", "Arabic", "Saudi", Language.ARABIC),
@jromero
jromero / CalendarGson.java
Created March 2, 2014 19:30
DateDeserializer for Gson based on different SimpleDateFormats
package org.dallasmakerspace.kiosk.data.calendar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.dallasmakerspace.kiosk.gson.DateDeserializer;
import java.text.SimpleDateFormat;
import java.util.Date;
@jromero
jromero / TextColorAnimator
Created March 3, 2014 19:02
Android: TextColorAnimator, animates the color of a given TextView.
class TextColorAnimator extends ValueAnimator implements AnimatorUpdateListener {
private TextView mTextView;
private TextColorAnimator(TextView textView, int startColor, int endColor) {
mTextView = textView;
setObjectValues(startColor, endColor);
setEvaluator(new ArgbEvaluator());
addUpdateListener(this);
}
@jromero
jromero / BaseDriver.java
Last active August 29, 2015 14:00
Basic SQL Driver implementation used in Connect2SQL
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import me.jromero.connect2sql.sql.ConnectionDetails;
/*
* Copyright (C) 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