Skip to content

Instantly share code, notes, and snippets.

@cherifya
cherifya / 1line-notepad
Last active December 12, 2015 01:38
One line notepad in browser with Save button for saving the snippet. Copy and paste the line in your browser's address bar. And voila!
data:text/html;charset=utf-8, <title>TextEditor</title><body contenteditable style="font-size:1.5rem;font-family:'Monaco', sans-serif;line-height:1.4;max-width:70rem;margin:0 auto;padding:3rem;background-color:rgb(233,233,225);color:rgb(68,68,68);" spellcheck="false"> <textarea id="txtBody" style="font-size: 1.5em; width: 100%; height: 90%; font-family: inherit;" autofocus> </textarea> <button onClick="SaveTextArea()" style="margin-top: 20px; font-size: 1.1em;">Save</button> <script language="javascript" type="text/javascript"> function SaveTextArea() { window.location = "data:application/octet-stream," + escape(txtBody.value); } </script> </body>
@cherifya
cherifya / FastCGI
Created November 29, 2012 13:59
FastCGI
#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
@cherifya
cherifya / worpress
Created November 29, 2012 14:04
Wordpress site config for nginx
server{
listen 80; #or change this to your public IP address eg 1.1.1.1:80
server_name wordpress; #change this to the domain name, for example www.myblog.com
access_log /var/log/wordpress.access_log;
error_log /var/log/wordpress.error_log;
location / {
root /home/your-user-name/Sites/wordpress;
index index.php index.html index.htm;
/**
* Connects to Apple Push Notification service server.
*
* @throws ApnsPHP_Exception if is unable to connect.
* @return @type boolean True if successful connected.
*/
protected function _connect()
{
$sURL = $this->_aServiceURLs[$this->_nEnvironment];
unset($aURLs);