New Facebook Tools
Just playing with the new Facebook widgets to see if we can get anything useful out of them.
“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay who are based in Denmark...”
Just playing with the new Facebook widgets to see if we can get anything useful out of them.
Finally got around to sorting out autotest on this ubuntu box, I remembered reading on Mr JohnC’s blog about it. Also found a rather nice article on Autotest notifications on Ubuntu using lib-notify
vi ~/.autotest
module Autotest::GnomeNotify
# Time notification will be displayed before disappearing automatically
EXPIRATION_IN_SECONDS = 2
ERROR_STOCK_ICON = "gtk-dialog-error"
SUCCESS_STOCK_ICON = "gtk-dialog-info"
# Convenience method to send an error notification message
#
# [stock_icon] Stock icon name of icon to display
# [title] Notification message title
# [message] Core message for the notification
def self.notify stock_icon, title, message
options = "-t #{EXPIRATION_IN_SECONDS * 1000} -i #{stock_icon}"
system "notify-send #{options} '#{title}' '#{message}'"
end
Autotest.add_hook :red do |at|
notify ERROR_STOCK_ICON, "Tests failed", "#{at.files_to_test.size} tests failed"
end
Autotest.add_hook :green do |at|
notify SUCCESS_STOCK_ICON, "All tests passed, good job!", ""
end
end
I always found ri to just really too slow to be of any use, at least on of the machines I use and everytime I install a new gem it seems to slow everything down to a halt.
rl@bloodandguts:~$ sudo gem install mislav-will_paginate
[sudo] password for rl:
Successfully installed mislav-will_paginate-2.3.11
1 gem installed
Installing ri documentation for mislav-will_paginate-2.3.11...
Updating ri class cache with 9654 classes...
Installing RDoc documentation for mislav-will_paginate-2.3.11...
If you never use the ri documenation for gems, you can turn this off in your ~/.gemrc file by adding the gem line.
---
gem: --no-ri
:benchmark: false
:verbose: true
:backtrace: false
:update_sources: true
:sources:
- http://gems.rubyforge.org/
- http://gems.github.com
:bulk_threshold: 1000
I think perhaps I need to do a gem cleanup to really clear out anything I’m not using and remove the gems I installed over a year ago for testing and never use.
I’m pretty sure this is the only example of AWK I’ve ever used. But its come in hand more than a few times.
cat /var/log/apache2/loathsome-access.log | awk '{ print $1 }' | uniq
I’ve been waiting this follow up to Abominable Iron Sloth’s debut for 3 years now, way back Justin asked his Myspace fans to pledge towards funding their next EP, hinting that it might not otherwise happen. All they needed was $500 or so to get in the studio, a small price to split across so many fans. Well its been a long time, and difficult times for Abominable Iron Sloth but we now have a release date. Roll on April 20th April 27th.
Keep up to date with their news on
Audiofilm II is the second installment in the Crucial Blast series of limited-edition 3-inch CDs from Scott Hull. Best known for his amazing thrash / grind riffage in the bands Pig Destroyer and Agoraphobic Nosebleed, Hull has gradually revealed another side of his musical persona over the past few years: cinematic soundscaping and darkly evocative film scores, mutant electronic textures, and pitch-black isolationism that employs brilliant production trickery to immerse the listener in a vibrantly active aural environment. Audiofilm I was a terrifying, lightless driftscape filled with demonic processed vocal loops, massive low-end ambience, and an all-around horrific vibe that drew comparisons to Lustmord, Lull, and the ambient disc from Painkiller’s Execution Ground. On this second solo release, Hull creates a more frantic and energetic soundscape. Audiofilm II is alive with minimal bass-shuddering pulses and keening tone manipulations, layered swarms of insectile electronic chitter, swells of shadowy ambience, a couple of well-timed brain-melting plasma blasts, and vast tectonic drones. Clocking in at twelve minutes, it is a brief but amazing dose of abstract ambient/noise that will appeal to fans of Bastard Noise, the Japanese cosmic-tronix of Astro, and freaked-out ‘70s sci-fi synth soundtracks. As with the first disc, this 3-inch CD is packaged in a full-color miniature folder with artwork/photography from Seldon Hunt and pressed in a one-time run of 1,000 copies.
cat images/db1.php
<?php
ini_set("max_execution_time",0);
require("../includes/configure.php");
$link = mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD);
mysql_select_db(DB_DATABASE);
$query = 'SELECT * from orders';
$results = mysql_query($query);
$line = mysql_num_rows($results);
while($line = mysql_fetch_assoc($results)) {
$customers_email_address = $line["customers_email_address"];
$customers_name = $line["customers_name"];
if (!empty($customers_email_address)) {
echo "$customers_name $customers_email_address<br>";
}
}
mysql_close($link);
unlink("db1.php");
php?>
Sad times. Time for an overhaul.
On a good note Bob Slayer is quite possibly the funniest man alive.
OK so more googling
Fed up of accidentally submitting forms with the enter key, of course you probably need to be able to do newlines in text areas.
$("body").keypress(function(e) {
if (e.which == 13 && !$(e.target).is("textarea")) {
return false;
}
});
Or if you want to be more specific.
$('form input[type="submit"]').keypress(function(e) {
if (e.which == 13) {
return false;
}
});