Skip to content

Instantly share code, notes, and snippets.

View jerieljan's full-sized avatar

Jeriel Jan del Prado jerieljan

View GitHub Profile
@jerieljan
jerieljan / ps3shot.sh
Created November 17, 2016 00:52
A simple script for processing screenshots taken with a PS3. Images are cropped (custom for me, edit it to fit your needs), files are renamed and modification dates are retained in a correct sequence.
#!/bin/bash
# This simple script processes screenshots taken with a PS3 and does multiple things:
# - Crops the image to a preferred size (this depends on the game used, remove if desired, or adjust as needed.)
# - Renames all images by sequence, sorted by modification date (dates are copied to the new files)
# Prepare a file list, sorted by modification date.
rm FILELIST 2>/dev/null
ls -tdr1 *.png > FILELIST;
@jerieljan
jerieljan / splice-video.sh
Last active August 7, 2016 03:36
This simple script splices a video file "trimmed.mkv" into multiple videos--defined by X-count and Y-count of screens. Requires ffmpeg.
#!/bin/bash
# This script splices a movie file into multiple parts.
# First parameter for the number of X screens
# Second parameter for the number of Y screens
X_COUNT=$1
Y_COUNT=$2
FILENAME="trimmed.mkv"
@jerieljan
jerieljan / custom_rules.xml
Created July 24, 2013 01:20
A custom_rules XML file in Ant for performing Robotium tests.
<?xml version="1.0" encoding="UTF-8"?>
<!-- custom_rules.xml contains a set of added functions for Ant to use. This includes useful macrodefs for
testing a particular test case or package, and you can even define your own that executes them for convenience. -->
<project name="RobotiumMyProject">
<property name="reports.dir" value="reports"/>
<property name="tests.dir" value="com.jerieljan.myproject.tests"/>
<target name="init-props">
@jerieljan
jerieljan / ShowListView.java
Created July 11, 2013 09:18
A slightly customized list view for displaying shows. Provides handling for touch event greed. This is used so that the main list will not deprive the ViewPager List from horizontal swipe events for changing displayed shows per channel.
package ph.com.voyager.epg.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;
/**
* A slightly customized list view for displaying shows. Provides handling for touch event greed.
* This is used so that the main list will not deprive the ViewPager List from horizontal swipe
package ph.com.voyager.epg.core.model.volley;
import com.android.volley.toolbox.ImageLoader;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
/**
* A straightforward implementation of the {@link ImageLoader.ImageCache ImageCache} in LruCache
* provided by Android + Support Library.
// Copyright 2008 - Team Servo
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;
@jerieljan
jerieljan / simple-sync
Last active August 29, 2015 14:17
A simple shell script that consistently observes a directory and synchronizes its contents when changes are found, using rsync's one-way sync.
#!/bin/sh
## A simple shell script that consistently observes a directory and synchronizes its contents when changes are found, using rsync's one-way sync.
## Most of the heavy lifting is really done by rsync, so what this script provides is just convenience over cron, notifications (if you have notify-pb) and rsync not being spammed by said cron job through a simple lockfile.
## simple-sync requires rsync, notify-pb (Pushbullet) and preferably run by a scheduler such as cron.
# Core variables
SYNC_HOME='/home/user'
SYNC_SOURCE='user@server.com:/path/to/source/*'
SYNC_DESTINATION="${SYNC_HOME}/path/to/destination/"
@jerieljan
jerieljan / manage-dir.sh
Last active August 29, 2015 14:08
Manage directories' files using a simple shell script! This script simply relocates files from a base directory to a subdirectory based on its file format.
#!/bin/bash
# A basic directory management script file.
# Add this to incron via incrontab -e with the IN_CLOSE_WRITE and IN_MOVED_TO flag.
# Usage: manage-dir.sh <file-to-process> <base-directory>
INCOMING="$1"
BASE_DIR="$2"
SUBFOLDER=""
ICON="/usr/share/icons/gnome/32x32/actions/document-save-as.png"
@jerieljan
jerieljan / Job.java
Created August 7, 2014 00:46
Dealing with long-running, processor-intensive tasks happen, and sometimes, requests for the same tasks get triggered and your system ends up attempting to process the -same- thing multiple times. JobManager is an attempt to resolve that by taking note of each Task<Result> as Jobs, which takes care of assigning future reattempts into existing Jo…
/*
* Job
* v1.0
* June 18, 2014
*
* Copyright 2014, Jeriel Jan del Prado
* 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
@jerieljan
jerieljan / facebook-css.css
Last active August 29, 2015 14:04
Facebook - No Right Column, Collapsed Left Column
#rightCol {
display:none !important;
}
#leftCol {
width:48px !important;
}
#leftCol:hover {
width:165px !important;