This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gå ind på mit bibob, vælg "Mit forbrug", skriv din periode, åben firebug, | |
* og brug konsollen og kopier følgende kode stump ind. Så kan du se hvor | |
* meget data du har brugt for den valgte periode. | |
*/ | |
var total = 0; | |
$('#table_0 table .usageCell5subsub nobr').each(function() { | |
total += Number($(this).text().split(' ')[0]); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you need to add a created_at field in your database | |
# that inserts "now()" when the insert statement is run, you | |
# can use the following script. | |
# It uses timestamps, but removes the "on update" for the | |
# created_at column, but keeps it on the updated_at (which | |
# needs to update at every change). | |
# | |
# got this snippet here: | |
# http://bugs.mysql.com/bug.php?id=27645 | |
# (search for: "[7 Oct 2009 4:25] Diego Medina") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* this.printout(data); cannot be called. The .each on the array removes the current scope | |
*/ | |
var EachTest = Class.create({ | |
test: function() { | |
var arr = Array(); | |
arr.push("a"); | |
arr.push("b"); | |
arr.push("c"); | |
arr.push("d"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* install firefox != 3.0 | |
http://mozilla.com | |
bunzip2 firefox.tar.bz2 | |
tar xfv firefox.tar | |
sudo mv firefox /usr/local/ | |
* rerun every at Ubuntu firefox update | |
cd /usr/bin | |
sudo mv firefox firefox_bak | |
sudo ln -s /usr/local/firefox/firefox . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#contact_form').bind('submit', function(e) { | |
return false; | |
}); | |
$('#submit_button').bind('click',function(e) { | |
e.stopPropagation(); | |
var contact = $('#form_name').val(); | |
var comment = $('#form_comment').val(); | |
if(contact != '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Event.observe('submit_button','click', function(e) { | |
e.stop(); | |
var contact = $('form_name').getValue(); | |
var comment = $('form_comment').getValue(); | |
if(contact != '') { | |
var phoneRegExp = new RegExp('^[+]{0,1}[0-9]+$'); | |
var emailRegExp = new RegExp('^[a-zA-Z0-9._+-]+[@]{1}[a-zA-Z0-9._-]+[.]{1}[a-zA-Z0-9]+$'); | |
if(phoneRegExp.test(contact) || emailRegExp.test(contact)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libssl-dev | |
sudo apt-get install libreadline5 libreadline5-dev libreadline-ruby1.8 readline-common | |
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6-p383.tar.gz | |
tar xzfv ruby-1.8.6-p383.tar.gz | |
cd ruby-1.8.6-p383 | |
./configure | |
make | |
sudo make install |