Skip to content

Instantly share code, notes, and snippets.

setlocale(LC_ALL, 'en_US.UTF8');
function generateSlug($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = strtolower(trim($clean, '-'));
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
<?php
// single page player of recent posts
// functions
function buildPlaylist($username, $password){
$url = 'http://www.tumblr.com/api/dashboard?username='.$username.'&password='.$password.'&num=50';
$c = curl_init($url);
curl_setopt($c,CURLOPT_HEADER,1);
curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
$output = curl_exec($c);
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
display: block;
height: 10px;
}
find ./ -name ".svn" | xargs rm -Rf
$homepage = file_get_contents('http://www.example.co.uk');
echo $homepage . '<script type="text/javascript" src="http://www.schillmania.com/projects/snowstorm/snowstorm.js"></script>';
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://www.w3.org/2005/Atom">
<xsl:strip-space elements="/users/user"/>
<xsl:output method="text"/>
<xsl:template match="/users/user">
<xsl:text>
g.add_edge( "deplorableword", "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>test</title>
<link rel="stylesheet" href="http://staticspace.net/jquery.colorbox/colorbox.css" type="text/css" media="screen" charset="utf-8" />
<?php
$list = null;
$allfiles = array();
foreach (new DirectoryIterator('./videos') as $fileInfo) {
/* hide system files / folders */
if($fileInfo->isDot()) continue;
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
$(document).ready(function() {
timedRefresh(5000);
});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>home</title>
<style type="text/css">