Skip to content

Instantly share code, notes, and snippets.

<VirtualHost *:80>
ServerName YOUR_SERVER_DOMAIN
ProxyPreserveHost On
ProxyPass / http://YOUR_NEW_SERVERS_IP_ADDRESS/
ProxyPassReverse / http://YOUR_NEW_SERVERS_IP_ADDRESS/
# i.e.
# ServerName your-domain.com
# ProxyPreserveHost On
# ProxyPass / http://127.0.0.1/
# ProxyPassReverse / http://127.0.0.1/
(function() {
$.fn.extend({
scrolltracker: function(step) {
var maxDepth;
maxDepth = 0;
return this.scroll(function() {
var depth;
depth = Math.floor($(this).scrollTop() / step);
if (depth > maxDepth) {
maxDepth = depth;
## jQuery extension that tracks the current scroll depth
$.fn.extend
scrolltracker: (step) ->
maxDepth = 0
this.scroll ->
depth = Math.floor($(this).scrollTop() / step)
if depth > maxDepth
maxDepth = depth
_gaq.push(['_trackEvent', 'ScrollDepth', depth * step]);
// # CoffeeScript
// $(document).ready ->
// $(window).scrolltracker(500)
$(document).ready(function() {
return $(window).scrolltracker(500);
});
<?php
$facebook = new Facebook(array('appId' => 'YOUR_APP_ID', 'secret' => 'YOUR_APP_SECRET'));
$note = array(
'subject' => 'Your new Note!',
'message' => '<h1>Your new Note</h1><p>This is your new note</p>',
);
$response = $facebook->api('/YOUR_USER_OR_PAGE_ID/notes', 'post', $note);
<?php
..
$client = $app['goutte.client'];
$crawler = $client->request('GET', 'http://test.ical.ly/');
..
<?php
require_once __DIR__ . '/silex.phar';
$loader->register();
$app = new Silex\Application();
$app[ 'autoloader' ]->registerNamespaces(array(
'Symfony' => __DIR__ . '/../vendor',
'Caefer' => __DIR__,
<?php
namespace Caefer;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Goutte\Client;
class GoutteServiceProvider implements ServiceProviderInterface
{
./src/silex.phar
./src/twig.phar
./src/bootstrap.php
./vendor/Symfony/Component/Console/...
./Readme.md
./console.php
./index.php
./views/hello.twig
./.htaccess
<?php
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/views',
'twig.class_path' => 'phar://'.__DIR__.'/twig.phar/lib',
));