Skip to content

Instantly share code, notes, and snippets.

@Mad182
Mad182 / varnish-config.vcl
Created June 27, 2013 09:55
My Varnish configuration
#
# My varnish config
# caches all static files (images, js, css, txt, flash)
# but requests from backend dinamic content
#
# webserver
backend default {
.host = "127.0.0.1";
.port = "8080";
@Mad182
Mad182 / optimize.sh
Created June 27, 2013 09:55
Recursive image optimization
#!/bin/bash
optimize() {
jpegoptim *.jpg --strip-all
optipng *.png
for i in *
do
if test -d $i
then
cd $i
echo $i
0-mail.com
0815.ru
0845.ru
0clickemail.com
0wnd.net
0wnd.org
10mail.com
10mail.org
10minutemail.cf
10minutemail.co.za
@Mad182
Mad182 / twitter_test.php
Created November 21, 2012 13:03 — forked from skakri/twitter_test.php
Twitter streaming API + URL unshortening
<?php
/**
* Unshorten links
*
* @param string $text
* @return string
*/
function unshorten_links($text) {
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
$callback = create_function('$matches', '