Skip to content

Instantly share code, notes, and snippets.

@g-P
g-P / print_gitbook.js
Last active January 26, 2022 14:02
Print Git Books
/*
If you try to print a gitbook directly, you get nothing but the contents because of their *just* use of `@media print` styling to hide away the content section of the books.
Fret not, here is the codez:
*/
$(".book-header,.book-summary,.navigation,.book-progress").remove();
$(".book.with-summary .book-body").css('left', '0px');
$("*").css('position', 'static');
window.print()
@g-P
g-P / eloquent_chapters.links
Created July 30, 2014 13:48
Eloquent Javascript
@g-P
g-P / phpredisadmin.conf
Created September 24, 2014 13:39
Add phpRedisAdmin to apache2
Alias /phpredisadmin /var/www/redisadmin
<Directory /var/www/redisadmin>
Options FollowSymLinks
DirectoryIndex index.php
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
@g-P
g-P / pre_opt
Last active August 29, 2015 14:08
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Super Heavy Website</title>
<meta name="description" content="A website that loads in 25 seconds is not something you see often!">
@g-P
g-P / post_opt
Last active August 29, 2015 14:08
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Super Heavy, But Optimized Website</title>
<meta name="description" content="A website that loads in 2.5 seconds is something you should see often!">