Skip to content

Instantly share code, notes, and snippets.


Marko Marković markomarkovic

View GitHub Profile

Keybase proof

I hereby claim:

  • I am markomarkovic on github.
  • I am markomarkovic ( on keybase.
  • I have a public key ASAe5YSZbzVN3R_GUc3i5N51pDulf0M4N8wvQT1eZ6sAQQo

To claim this, I am signing this object:

markomarkovic / switch-desktop-background
Last active Aug 29, 2015
Automatically switch desktop background to latest Bing image
View switch-desktop-background
#!/usr/bin/env bash
# Fetches the latest Bing image and sets it as desktop background
# Requirements:
# curl, jq, nitrogen, convert (imagemagick)
# Installation:
# sudo cp switch-desktop-background /usr/local/bin/
# sudo chmod +x /usr/local/bin/switch-desktop-background
#!/usr/bin/env bash
# Uses GraphicsMagick to stich together all images in a folder and
# generates a CSS file with the correct offsets along with a
# test HTML page for verification
if [ $# -gt 0 ]
if [ $3 ]
markomarkovic / paging.ctp
Created Oct 25, 2012 — forked from justinyost/paging.ctp
Paging Element for Twitter Bootstrap and CakePHP 2.0+
View paging.ctp
<?php $span = isset($span) ? $span : 8; ?>
<?php $page = isset($this->request->params['named']['page']) ? $this->request->params['named']['page'] : 1; ?>
<?php $pages = (int)$this->Paginator->counter('{:pages}'); ?>
<div class="pagination pagination-centered">
<?php echo $this->Paginator->prev(
'&larr; ' . __('Previous'),
'escape' => false,
'tag' => 'li'
markomarkovic /
Created Nov 2, 2011
A script to compile PHPUnit-3.5.15 with all dependencies into archive which can be extracted to CakePHP 2.0 Vendor directory in order to UnitTest cake (if you don't have access to PEAR commands or PEAR insists on installing PHPUnit-3.6.0 and not working).
# Creating temp dirs
mkdir .compile_PHPUnit_$$
cd .compile_PHPUnit_$$
# Fetching the archives
wget -nv
wget -nv
wget -nv
markomarkovic / belgrade_flight_schedule.php
Created Feb 8, 2011
Quick'n'Dirty CakePHP Model for fetching and parsing Belgrade airport flight schedule RSS
View belgrade_flight_schedule.php
class BelgradeFlightSchedule extends AppModel {
var $useTable = false;
var $name = 'BelgradeFlightSchedule';
var $arrivalsURL = '';
var $departuresURL = '';
function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
Cache::config('flight_schedule', array('engine' => 'File', 'duration' => '10 minutes'));
$schedule = Cache::read('flight_schedule');
You can’t perform that action at this time.