Skip to content

Instantly share code, notes, and snippets.

View imamo's full-sized avatar

Danijel Ocepek imamo

View GitHub Profile
@imamo
imamo / get-page-list-for-folder.php
Created September 2, 2011 06:38 — forked from eanticev/get-page-list-for-folder.php
Pagelime Page Listing using FTP-XML
<?php
function pagesForFolder($folderName) {
$pages = array();
// this is the path to the sitemap XML that Pagelime publishes
$pages_path = "/cms-assets/xml/sitemap.xml";
// if the XML file exists, keep going
if (file_exists($_SERVER["DOCUMENT_ROOT"].$pages_path)) {
// initialize an XML DOM Document
$xml = new DOMDocument;
@imamo
imamo / Menu in php.php
Created August 11, 2011 07:42
Menu in php
<?php
$pages["index.php"] = "Home";
$pages["about.php"] = "About Us";
$pages["products.php"] = "Products";
$pages["price-list.php"] = "Price List";
$pages["contact.php"] = "Contact";
$active_page = basename($_SERVER["REQUEST_URI"]);
foreach($pages as $page => $page_title)
@imamo
imamo / Active menu class.js
Created August 11, 2011 07:36
Active menu class
$(function(){ // Start up jQuery
$("#top_nav a").each(function() {
if(this.href == window.location) $('#top_nav li').addClass("active");
});
});
@imamo
imamo / div-bottom-checker.js
Created May 4, 2011 13:56
Preveri ali je drsnik do dna div-a
$(document).ready(function(){
$('div').bind('scroll',chk_scroll);
});
function chk_scroll(e)
{
var elem = $(e.currentTarget);
if (elem[0].scrollHeight - elem.scrollTop() == elem.outerHeight())
{
@imamo
imamo / Pyrocms-blog-front.html
Created April 30, 2011 19:36
PyroCMS - Blog articles on front page
{pyro:blog:posts limit="5" order="desc"}
<h2><a href="news/view/{slug}">{title}</a></h2>
{intro}
{/pyro:blog:posts}
----- with read more button/link -----
{pyro:blog:posts limit="5" order="desc"}
<h2><a href="news/view/{slug}">{title}</a></h2>
{intro}
@imamo
imamo / IMAMOSnippet
Created January 21, 2011 00:02
Summary of Snippets for autocomplete Brackets and Quotes for Espresso app & Snippets.xml file
<!--Snippets Added by IMAMO -->
<snippet id="si.imamo.TextActions.HTML5.CurlyBracket" category="hidden">
<title>Open Curly Bracket</title>
<text-trigger key-equivalent="{"></text-trigger>
<text>{$0}</text>
<syntax-context>html, html *,container.block.source.php, container.block.source.php > *, xml, xml *, js, js * </syntax-context>
</snippet>