Skip to content

Instantly share code, notes, and snippets.

<?php
interface activity_item {
public function get_time();
public function get_message();
public function get_row(); // assoc array containing time, lang, args
}
class default_activity_item implements activity_item {
<?php
function my_join_clan_hook($user_id, $clan_id) {
if ($user_id == registry::$user->id) {
registry::$activity_box->add(new default_activity_item(time(), 'ACTIVITY_JOIN_CLAN', array(get_username($user_id), get_clan_name($clan_id)));
}
}
<?php
class activity_box {
private $items = array();
private $user_id;
private $exists = true;
public function __construct($user_id) {
$this->user_id = (int) $user_id;
<?php
/**
* Main file
*
* @package mpv
* @version $Id: mpv.php 126 2009-11-18 03:41:24Z davidiq $
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
Index: mpv
===================================================================
--- mpv (revision 0)
+++ mpv (revision 0)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+php "$(dirname $0)/cli.php" "$@"
Property changes on: mpv
diff --git a/lib/cramp/controller/websocket.rb b/lib/cramp/controller/websocket.
index f32afe0..87acd7a 100644
--- a/lib/cramp/controller/websocket.rb
+++ b/lib/cramp/controller/websocket.rb
@@ -13,8 +13,8 @@ module Cramp
upgrade = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
upgrade << "Upgrade: WebSocket\r\n"
upgrade << "Connection: Upgrade\r\n"
- upgrade << "WebSocket-Origin: #{@env['HTTP_ORIGIN']}\r\n"
- upgrade << "WebSocket-Location: #{location}\r\n\r\n"
/* Ismael Celis 2010
Simplified WebSocket events dispatcher (no channels, no users)
// conn is an instance of WebSocket
var socket = new ServerEventDispatcher(conn);
// bind to server events
socket.bind('some_event', function(data){
alert(data.name + ' says: ' + data.message)
});
<FilesMatch "\.(txt|json)$">
<IfModule mod_headers.c>
Header set "Access-Control-Allow-Origin" "*"
</IfModule>
</FilesMatch>
if (echo $branch | grep '^ticket/')
then
ticket_id="$(echo $branch | sed "s/ticket\///g")"
cat > "$1" <<EOF
[$branch] $(cat "$1")
PHPBB3-$ticket_id
EOF
fi