Skip to content

Instantly share code, notes, and snippets.

View paraboul's full-sized avatar
🏠
Working from home

Anthony Catel paraboul

🏠
Working from home
View GitHub Profile
/*
Copyright (C) 2006, 2007, 2008, 2009 Anthony Catel <[email protected]>
This file is part of APE Server.
APE is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
APE is distributed in the hope that it will be useful,
/*
Copyright (C) 2006, 2007, 2008, 2009 Anthony Catel <[email protected]>
This file is part of APE Server.
APE is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
APE is distributed in the hope that it will be useful,
switch(*(int *)data) {
case 542393671: /* GET + space */
http->type = HTTP_GET;
break;
case 1414745936: /* POST */
http->type = HTTP_POST;
break;
default:
http->error = 1;
return;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="demo.css" media="screen" title="Normal" />
<script type="text/javaScript" src="../../Clients/JavaScript.js"></script>
<script type="text/javaScript" src="../config.js"></script>
</head>
<body>
<?php
gc_enable();
class Ape_dispatcher
{
private $_socks = array();
private $_socks_write = array();
private $_timers = array();
<html>
<head></head>
<body>
<?ape
var x = 'foo' // some javascript
Ape.async('<img src="load.gif" />', Ape.mysql.query('SELECT foo FROM bar', function(res) {
echo(res[0].foo + ' yeahhhh');
}))
?>
</body>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct parent {
int foo;
char *bar;
};
@paraboul
paraboul / client-side.js
Created February 22, 2011 08:58
APE SSH
/***************** Client-side ********************/
APE.ssh = new Class({
Extends: APE.Client,
initialize: function(container){
this.term = null;
this.addEvent('load', this.start);
@paraboul
paraboul / gist:866345
Created March 11, 2011 18:40
Add latency to localhost
#!/bin/bash
# Copyright 2010 Eric Ryan Harrison <[email protected]>
# Inspired by:
# http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
if [ -n "$1" ]
then
if [ "$1" = "off" ]
then
tc qdisc del dev lo root
@paraboul
paraboul / C.c
Created May 27, 2011 15:20
C VS PHP
uint x[3] = {0x42, 0x69, 0x13};
int i = 0;
printf("Res : %x\n", x[i++] << 16 | x[i++] << 8 | x[i++]);
/* Output 0x424242 */