This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON('/twitter.php', function(data){ | |
$(data).each(function(){ | |
var text = this.text; | |
var stamp = Date.parse(this.created_at); | |
var now = new Date(); | |
var diff = Math.round((now - stamp) / 1000); | |
var time = ''; | |
if(diff == 1) { time = '1 seconde geleden: '; } else | |
if(diff <= 60) { time = diff + ' seconden geleden: '; } else | |
if(diff <= 120) { time = '1 minuut geleden: '; } else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin image-block($image) { | |
display: block; | |
outline: none; | |
text-indent: -1000em; | |
background: image-url($image); | |
width: image-width($image); | |
height: image-height($image); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The slideshow: | |
if(Modernizr.cssanimations) | |
{ | |
// Decent browser, use blazing fast css animations: | |
var slides = document.querySelectorAll('#banners div.slide'); | |
var currentSlide = 0; | |
function nextSlide() | |
{ | |
slides[currentSlide].className = 'slide'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tweets"> | |
<ul id="tweets_ul"> | |
<xsl:for-each select="twitter-feed/atom:entry"> | |
<li> | |
<a href="{atom:author/atom:uri}" target="_blank"> | |
<img src="{atom:link[@rel='image']/@href}" title="{substring-before(atom:author/atom:name, ' ')}" alt="tweet van {substring-before(atom:author/atom:name, ' ')}" width="48" height="48" /> | |
</a> | |
<div> | |
<strong><a href="{atom:author/atom:uri}" target="_blank"><xsl:value-of select="substring-before(atom:author/atom:name, ' ')" /></a></strong> | |
<xsl:text> : </xsl:text> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set the X and Y property of the element | |
* | |
* @param elem | |
*/ | |
function setXY(elem) | |
{ | |
elem.x = elem.offsetLeft; | |
elem.y = elem.offsetTop; | |
var parent = elem.offsetParent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to make Symphony more 'enterprisy': | |
- Store pages in external XML files. | |
- Store sections in external XML files. | |
- Have a layer between `tbl_entries` and `tbl_entries_data` and work with views: | |
Entry | |
- View | |
- Data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Stel locale in | |
setlocale(LC_ALL, 'nl_NL'); | |
// Dinsdag, 3 Maart 2012 | |
echo strftime('%A, %e %B %Y', $stamp); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add cross-browser prefix with javascript | |
* @param node | |
* @param style | |
* @param value | |
*/ | |
function cssPrefix(node, style, value) | |
{ | |
if(node) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* SmallLog | |
* | |
* Usage: | |
* | |
* SmallLog::instance()->setPath('path/to/log/directory'); | |
* SmallLog::add('This line is added to the log'); | |
* SmallLog::add('This line too'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (jQuery) { | |
jQuery.fn.extend({ | |
incrementButtons:function (options) { | |
var defaults = { | |
minVal:null, | |
maxVal:null, | |
incClass:'inc', | |
decClass:'dec', |