Skip to content

Instantly share code, notes, and snippets.

History

Year JavaScript jScript ES ES Additions
96 1.0, 1.1 1.0 1
97 1.2 3.0 1 (1st Edition)
98 1.3
99 5.0, 5.1 2 (Editorial changes only)
00 1.5 5.5 3 RegExp, Try/Catch, standardized the switch statement
01 5.6
@paleo9
paleo9 / vim-related.md
Last active April 14, 2018 22:09
Anything to do with vim

PHP Memcached

PHP Sessions don't work on clusters, memcached provides a solution. The procedure is as follows:

create a new Memcached object
call memcached::addServer
retrieve the value with memcached::get
if the value was retrieved successfully
 carry on
@paleo9
paleo9 / php-debugging.md
Last active September 11, 2017 23:50
Using debuggers with PHP

PHP Debugging

At the time of writng I am using Debian Testing (stretch). The php-xdebug package has php7.0 as a dependency so it will be installed by default.

Installation

apt-get install php-xdebug

Using with Vim

The vdebug plugin requires python support in vim, but the version supplied by Debian

@paleo9
paleo9 / php-profiling.md
Last active September 11, 2017 21:24
PHP Profiling

PHP Profiling with XDebug Profiler

Profiling shows up any bottlenecks in a program, it gives real metrics that can be analysed. Looking at the code and making educated guesses at the problem areas is usually ineffectual.

We need to profile the whole user experience so that it includes complex JavaScript and external effects due to latency and distance, load balancers and so on. Usefule tools may be Graphite, LogStash. But that's for another article. Here I am just dealing with backend.

@paleo9
paleo9 / laravel-routes.md
Last active August 29, 2015 14:05
laravel routes from their tutorial pages

Basic routing

most defined in app/routes. Simplest consist of a URI and a callback.

Basic GET

Route::get('/', function()
{
 return 'Hello World';
@paleo9
paleo9 / wp-plugins.md
Last active August 28, 2017 13:27
Wordpress Plugins

Wordpress Plugins

Plugins are typically PHP files that add functionality. Located under wordpress/wp-content/plugins.

A Minimal plugin

wordpress/wp-content/minimal.php

  <?php
 /*
@paleo9
paleo9 / xen-and-systemd
Created November 3, 2012 16:01
Integrating Xen 4.2 with Systemd.
Integrating Xen 4.2 AUR with Systemd.
=================================
I tested the AUR package with a fresh installation of Arch of x86_64. Only
packages 'base', 'base-devel'and the dependencies mentioned on the site
were installed.
* package build also requires dev86
* dev86 is in multilib, x86_64 users need to enable multilib in /etc/pacman.conf
* users need to add a new entry to their bootloader config file (mentioned)