Skip to content

Instantly share code, notes, and snippets.

@dbu
dbu / git-status-recursive
Created May 31, 2012 14:14
recursive git status
#!/usr/bin/php
<?php
$repos = array();
exec('find -type d -name .git | sed -e "s/\.git//"', $repos);
foreach ($repos as $repo) {
$status = shell_exec("cd $repo && git status");
if (false == strpos($status, 'nothing to commit (working directory clean)')) {
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n";
}
}
@dbu
dbu / gist:982774
Created May 20, 2011 11:45
last news
$de_index = 0;
$lastFrench = null;
foreach ($db->query('SELECT * from fluxcms_blogposts order by post_date desc') as $row) {
...
if ($row['post_lang'] == 'de') {
if ($lastFrench == null) {
$lastFrench = $de_index;
}
$de_index++;