Skip to content

Instantly share code, notes, and snippets.

Marko Marković markomarkovic

Block or report user

Report or block markomarkovic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am markomarkovic on github.
  • I am markomarkovic (https://keybase.io/markomarkovic) on keybase.
  • I have a public key ASAe5YSZbzVN3R_GUc3i5N51pDulf0M4N8wvQT1eZ6sAQQo

To claim this, I am signing this object:

@markomarkovic
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
View buildSprite.sh
#!/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 ]
then
if [ $3 ]
@markomarkovic
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">
<ul>
<?php echo $this->Paginator->prev(
'&larr; ' . __('Previous'),
array(
'escape' => false,
'tag' => 'li'
@markomarkovic
markomarkovic / compile_PHPUnit-3.5.15.sh
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).
View compile_PHPUnit-3.5.15.sh
#!/bin/sh
# Creating temp dirs
mkdir .compile_PHPUnit_$$
cd .compile_PHPUnit_$$
# Fetching the archives
wget -nv http://pear.phpunit.de/get/PHPUnit-3.5.15.tgz
wget -nv http://pear.phpunit.de/get/DbUnit-1.0.0.tgz
wget -nv http://pear.phpunit.de/get/File_Iterator-1.2.3.tgz
@markomarkovic
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
<?php
class BelgradeFlightSchedule extends AppModel {
var $useTable = false;
var $name = 'BelgradeFlightSchedule';
var $arrivalsURL = 'http://www.beg.aero/rss/time_table_arrivals.php?versionId=1&type=IA';
var $departuresURL = 'http://www.beg.aero/rss/time_table_departures.php?versionId=1&type=ID';
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.