Skip to content

Instantly share code, notes, and snippets.

@lplume
lplume / stackoverflow_tagged_quest.php
Created January 24, 2011 16:37
mini wrapper web based, look for questions w/ tagged and min score given
<?php
/*
* uri param to this "web script"
* q = tag values split by a semicol
* minscore = min score (int)
*
* it's a lil bit nasty, but can modify so easy, the same to turn into a shell script
*/
$url = "http://api.stackoverflow.com/1.0/questions?tagged=".urlencode($_GET["q"]);
@lplume
lplume / gist:766364
Created January 5, 2011 14:13
jQuery ui sortable & selectable wating jQueryUi 1.9 milestone, i put together piece of code here and there (from the web) as a workaround to get an element both sortable and selectable. Be careful... This is really a workaround..
/**
* Disable sortable while target element fired
* - mouseover event AND
* - CTRL keydown
*/
var jid_element = "#" + myElement;
var isCtrl = false;
var isOver = false;
$(jid_element).mouseover(function() {isOver = true});
@lplume
lplume / alternateBackground.php
Created December 3, 2010 14:04
a way to alternate background HTML color in a dinamically generated list
<?php
$styler = true;
foreach($questions as $q) {
$color = ($styler) ? "#335533" : "#553355"; $styler = !$styler;
echo "<li style='background:$color;'>$q->text</li>";
}