Skip to content

Instantly share code, notes, and snippets.

# Pfad zum Git auf dem Server
set :repository, 'file:///VERZEICHNISNAME.git'
# Eure Domain
set :domain , 'domain.tld'
# SSH-Nutzer
set :user , 'ssh-w00000x'
# Verwendung von Git
@marcoraddatz
marcoraddatz / detection.js
Last active December 19, 2015 23:59
Small piece of JavaScript to detect a retina display and exchange `.icon-class` with `.icon-retina-class` to display retina images. Note that sprites should be aligned horizontally if you use Compass due to a bug.
<script type='text/javascript'>
$(document).ready(function() {
if (window.devicePixelRatio > 1) {
$.each($("[class^=icon-]"), function() {
var el = $(this), bp = el.css('background-position');
el.attr('class', el.attr('class').replace('n-', 'n-retina-')).css('background-position', bp);
});
}
});
</script>
@marcoraddatz
marcoraddatz / link_example.html
Created August 3, 2011 09:27
url2video: Simple link example
@marcoraddatz
marcoraddatz / link_to_youtube_example.php
Created August 2, 2011 14:45
url2video: Youtube / Vimeo examples
@marcoraddatz
marcoraddatz / jQuery_media_example.js
Last active September 26, 2015 15:38
url2video: jQuery snippet for video implementation
<script type="text/javascript">
$('.js-media').each(function() {
var $this = $(this);
$.getJSON(this.title, function(data) {
$this.html(data.html);
});
});
</script>
@marcoraddatz
marcoraddatz / bbcode_example.php
Created August 2, 2011 14:03
url2video: BBCode example
<?php
# using [audio]file.ext[/audio]
if (preg_match('#\[audio\](.*)\[\/audio\]#Uis', $sStr, $aMatch)) {
$sUrl = 'http://url2video.com/?url=' . $aMatch[1] . '&w=' . MEDIA_DEFAULT_X . '&h=30&callback=?';
$sStr = preg_replace('#\[audio\](.*)\[\/audio\]#Uis',
'<div class="js-media" title="' . $sUrl . '"><a href="' . $sUrl . '">' . $aMatch[1] . '</a></div>',
$sStr);
}