I sometimes look at the intervals table of my workouts of my favourite run log http://runningahead.com. It's missing a speed column though, which I sometimes prefer over a pace. This little script adds it :)
I've only run it so far in
- Firefox (tested with Greasemonkey)
Read the entire post to view the source.
I was looking for a web-based project that allows one to do CRUD operations in an easy way, without needing a complex GUI such as phpMyAdmin or adminer. A very limited amount of good solutions were found, so I set out to create my own project: PHP MySQL Explorer (PME for short?)
Rename the file
index.php to something else (or just keep it that way), add a configuration file, which has the same name but the suffix
.inc.php instead of
.php, and add the following minimal data to the file
1 2 3 4 5 6
<?php $host='localhost'; // where to connect to -- usually something like localhost $db=''; // MySQL database name $user=''; // MySQL username $pw=''; // MySQL password for the user
Now you can just browse, edit, update and delete rows on all tables. If the database is designed with foreign keys, it will take those into account and create links where necessary.
- CRUD operations on tables in a basic but function GUI
- Written in PHP *(dunno if that's a feature?) using PDO
- Automatically creates links using the foreign key constraints (hence the database must be a InnoDB, and not a MyISAM)
- Additional user system
- Permissions for users for any of the CRUD operations on any table using a simple rule system
- Configurable (and includes a configuration generator)
You can try it out on the demo page, with username demo and password demo.
On this server I host several git repositories, and sometimes I want to add update a single file in a large repository. It would be quite convenient if I could just update the bare repository without doing a checkout (it saves on space, no trouble with outdated repositories etc)
Obviously, someone on the internet already had asked the same question. I just put it in a nice script, with a simple test to ensure it works :)
You can download the script called git-bare-add, and view the source of the script below.
Usage is quite simple:
git bare-add [-b $BRANCH] $BARE-REPO $REL-PATH $NEW-ABS-FILE $COMMIT-MSG
$BARE-REPO is the path to the bare repository,
$REL-PATH the path to the file inside the repository that should be updated.
$NEW-ABS-FILE is the absolute filepath to the file that should be copied to
$REL-PATH inside the repository.
$COMMIT-MSG is (obviously) the commit message.
One can also edit a file in place, by using the option
--edit and dropping the
git bare-add --edit [-b $BRANCH] $BARE-REPO $REL-PATH $COMMIT-MSG
To perform some tests:
git bare-add --test
It should be relatively safe to use this script, since it makes use of git porcelain stuff.
Note that there is no safety regarding multiple simultaneous accesses. Thus it is best used on a repository where you are for sure the only writer (during the whole length of the edit), since I think it will ignore commits made while edits are being made.
Wilkinson-Rogers to code convertor. Look at wilkinson2formula.html for more info!
Some web pages (e.g. reddit) aggregate a lot of useful youtube links, but provide no way of playing them all, without adding them manually in a playlist.
That is where my next little project comes in. You give it an URL, it looks for all the URLs that look like they point to a youtube video, generates a list and a video player that will automatically play them all.
Usage is very simple:
- $URL is a single URL, or a ";;"-separated list of URLs (yes, two semicolons)
- To just list songs in order: http://jerous.org/tools/yt-list.php?url=$URL
- To list the songs and shuffle: http://jerous.org/tools/yt-list.php?shuffle=1&url=$URL
Currently there is a limit of 120 videos, imposed by the youtube API.
Try it out on following resources
For simulations I need to call functions in MATLAB and retrieve results from within a omnet++ simulation. There is documentation, however, it took me a while before I got it all working. So, I ended up with a small wrapper class that allows one to evaluate MATLAB code in a running MATLAB instance.
Because MATLAB has to start up the GUI every time the simulation starts (edit: I discovered it has a flag
-nojvm -nodisplay -nodesktop which speeds this up), it gets quite slow and annoying, and thus I also looked at writing a wrapper for octave, a language that is largely compatible with MATLAB.
Another advantage of using octave, instead of MATLAB is that octave is a shared library that runs in the same process, so one can pass around pointers.
By flipping a switch, the code will be either MATLAB or octave based.
The source and very simple, small examples can be found in source.tgz (5 KiB, modified on 27 January 2016, MD5 0b00489725ee2afbd929429f004c2355)
Click the read more link for some more info. read more...
The Settle Up app is pretty useful; it lets you share bills quite easily with groups of people. It's pretty good, except for the fact it has no web interface, and thus useless for people without a smartphone (or tablet) at hand. I and a group of friends had to settle up a visit to Amsterdam, and my fingers itched to quickly jot a webpage, where you could just easily view and edit the data, and also have a set of transactions (not guaranteed to be the minimal set though).
edit 29/01/2016: I've moved the remainder of this post to the tab-out page.
The imperial unit system, defined by the British in 1824, is still floating around everywhere, despite the International System of Units being a better system (well-defined, using only seven base units).
However, in other scenarios, such as the internet, it only makes it more difficult to put things into perspective if one is too lazy to make the calculation (e.g. "I ran 30 ft today!", or "I lifted 20 stone". Should I be impressed?).
Hence, I wrote a simple GreaseMonkey script, which looks for patterns of a number and an imperial unit, and adds the conversion (while also showing the original)
It is quite simple, and hence has some limitations: it will only convert upon page load (thus AJAXy pages won't benefit), looks for very specific patterns (hence "10 and 20 miles" will have only the latter replaced), it sometimes might not recognize some numbers, or sometimes it might convert too much. Another caveat is that the script assumes that thousands are separated by a comma (e.g. ten thousand is either 10000 or 10,000): the comma is removed alltogether from the string.
I've only run it so far in
- Firefox (tested with Greasemonkey)
Read the entire post to view the source. I've also added a simple HTML page with some units to have a quick look at the output.