This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** XHProf configuration */ | |
if ( isset( $_REQUEST['pressjitsu-profile'] ) && $_REQUEST['pressjitsu-profile'] == 'enable' ) { | |
xhprof_enable( XHPROF_FLAGS_MEMORY | XHPROF_FLAGS_CPU ); | |
ob_start(); | |
register_shutdown_function( function() { | |
ob_end_clean(); | |
header( 'Content-type: application/octet-stream' ); | |
header( sprintf( 'Content-Disposition: attachment; filename="%d.perf.xhprof"', time() ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /etc/ssl/nginx | |
wget -P /etc/ssl/nginx/ https://cs.nginx.com/static/files/CA.crt | |
## move nginx-repo.crt to /etc/ssl/nginx/nginx-repo.crt | |
## move nginx-repo.key to /etc/ssl/nginx/nginx-repo.key | |
wget http://nginx.org/keys/nginx_signing.key | |
apt-key add nginx_signing.key | |
apt-get install apt-transport-https libgnutls26 libcurl3-gnutls | |
printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Detect if the browser is running in Private Browsing mode | |
* | |
* @export | |
* @returns {Promise} | |
*/ | |
export default function isPrivateMode() { | |
return new Promise((resolve) => { | |
const on = () => resolve(true); // is in private mode | |
const off = () => resolve(false); // not private mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Node.js IL Chat</title> | |
<script type="text/javascript" src="/jquery-1.6.4.min.js"></script> | |
<script type="text/javascript" src="/socket.io/socket.io.js"></script> | |
<script language="javascript"> | |
var socket; | |
$(document).ready(function() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# variables | |
LOGFILE="/var/log/nginx/access.log" | |
LOGFILE_GZ="/var/log/nginx/access.log.*" | |
RESPONSE_CODE="200" | |
# functions | |
filters(){ | |
grep $RESPONSE_CODE \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
# Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
#gzip on; | |
gzip_disable msie6; | |
gzip_static on; | |
gzip_comp_level 4; | |
gzip_proxied any; | |
# Again, be careful that you aren't overwriting some other setting from another config's http {} section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list" | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<!-- really dirty! this is just a test drive ;) --> | |
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script> | |
<script type="text/javascript"> | |
function renderPDF(url, canvasContainer, options) { | |
var options = options || { scale: 1 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $touchArea = $('#touchArea'), | |
touchStarted = false, // detect if a touch event is sarted | |
currX = 0, | |
currY = 0, | |
cachedX = 0, | |
cachedY = 0; | |
//setting the events listeners | |
$touchArea.on('touchstart mousedown',function (e){ | |
e.preventDefault(); |
OlderNewer