Skip to content

Instantly share code, notes, and snippets.

View feulf's full-sized avatar
🐢
slow and steady wins the race

Federico feulf

🐢
slow and steady wins the race
View GitHub Profile
@feulf
feulf / gist:6229858
Created August 14, 2013 10:33
tmux fede
# Enable mouse support in ~/.tmux.conf
setw -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set -g mouse-resize-pane on
set -g mouse-select-window on
# enable pbcopy pbpaste
set-option -g default-command "reattach-to-user-namespace -l bash"
@feulf
feulf / gist:4587709
Last active July 27, 2022 11:15
Keep the same PHP session between different domains

a simple idea is to force the session_id between the domains with an ajax call or an hidden iframe.

The concept is simple, you have [A,B,C] domains, where you create a script sid.php:

<?php session_id( $_GET['sid'] );

and a script sid_update.php that you have to place inside the PHP code of the front controller:

@feulf
feulf / gist:4437179
Created January 2, 2013 19:30
This snippet is an HTML page with a Javascript that "emulate" Varnish loading the <esi:include> blocks client side. The idea is to create a dynamic website in HTML loaded in S3, with groundbreaking performances. Hope this experiment will inspire better solutions.
<!DOCTYPE html>
<html>
<head></head>
<body>
<esi:include src="head.html" alt="not-found.html" onerror="continue"></esi:include>
<esi:include src="body.php" alt="not-found.html" onerror="continue"/>
<h2>HTML</h2>
</esi:include>
<esi:include src="footer.html" alt="not-found.html" onerror="continue"/></esi:include>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>