Skip to content

Instantly share code, notes, and snippets.

@bugsysop
bugsysop / longpost.php
Last active August 29, 2015 13:56 — forked from texnixe/longpost.php
Template for Kirby CMS that splits long post into several pages
<?php
// Source and documentation : http://www.texniq.de/en/kirby-wiki/split-long-posts-into-pages
// store the content of the kirbytext text variable in $text
$text = kirbytext($page->text());
// split the content of $text whenever a <!--pagebreak--> code is encountered and store in the array $pages
$pages = explode('<!--pagebreak-->', $text);
@bugsysop
bugsysop / kirby-first-paragraph.php
Last active August 29, 2015 14:05
Kirby - Extract the first paragraph from an article
<?php
//If you want to remove the paragraph tags from the resulting string, uncomment the second line of the function.
function getFirstPara($string){
$string = substr($string,0, strpos($string, "</p>")+4);
//$string = str_replace("<p>", "", str_replace("<p/>", "", $string));
return $string;
}
$text = getFirstPara(kirbytext($page->text())); ?>
?>
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
@bugsysop
bugsysop / .gitignore
Created August 20, 2011 16:26 — forked from Fil/.gitignore
Outil pour créer une copie locale statique de "mes" seens
# ma config
seen-local-config.php
# stockage de mon backup xml
tmp/
# mes fichiers exportes
seen/
# mac os x
@bugsysop
bugsysop / menu.xml
Created April 6, 2012 21:53
Openbox menu file - Fichier de configuration pour le menu Openbox
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://openbox.org/
file:///usr/share/openbox/menu.xsd">
<!-- after modification run the "reconfigure" command for openbox -->
<menu id="root-menu" label="Openbox 3">
@bugsysop
bugsysop / style.css
Created June 3, 2012 04:23
h5ai (0.20) unminified style sheet
*/
* h5ai 0.21
*/
article,
aside,
details,
figcaption,
figure,
footer,
@bugsysop
bugsysop / RecordFindChange_CS3-CS5.jsx
Created June 18, 2012 03:32
An InDesign CS3--CS5 JavaScript. Writes the current find/change preferences to a text file so that you can copy/paste them into a find/change list file.
// RecordFindChange_CS3-CS5.jsx
//
// An InDesign CS3--CS5 JavaScript
// Writes the current find/change preferences to a text file so that
// you can copy/paste them into a find/change list file.
// Kasyan Servetsky - http://kasyan.ho.com.ua/scripts_by_categories.html
String.prototype.cleanProps = function ()
{
@bugsysop
bugsysop / tw-bootstrap-carousel.html
Created July 9, 2012 08:27
Twitter Bootstrap - JS Carousel
@bugsysop
bugsysop / tw-bootstrat-modal.html
Created July 9, 2012 08:32
Twitter Bootstrap - JS Modal Window
<!--Javascript modal window in Twitter Bootstrap-->
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button class="close" data-dismiss="modal">&times;</button>
<h3>Modal Heading</h3>
</div>
<div class="modal-body">
<h4>Text in a modal</h4>
</div>