Skip to content

Instantly share code, notes, and snippets.

View fran's full-sized avatar

Francisco José Seva mora fran

View GitHub Profile
@shlomohass
shlomohass / jQuery-mousewheel-direction-capture.js
Last active October 28, 2022 20:24
jQuery - Get mousewheel scroll event to detect scrolling direction cross browser
$('body').on('mousewheel DOMMouseScroll', function(e){
if(typeof e.originalEvent.detail == 'number' && e.originalEvent.detail !== 0) {
if(e.originalEvent.detail > 0) {
console.log('Down');
} else if(e.originalEvent.detail < 0){
console.log('Up');
}
} else if (typeof e.originalEvent.wheelDelta == 'number') {
if(e.originalEvent.wheelDelta < 0) {
console.log('Down');
@DavidHernandez
DavidHernandez / d7-autologin.php
Created October 16, 2014 17:19
This is another PoC for the SA-CORE-2014-005 vulnerability. Instead of updating the users table, activates an anonymous session to change your session into admin.
<?php
/**
* D7 autologin.
* Exploits SA-CORE-2014-005 to change your anonymous session into an uid 1 session.
* In order to work, first you need to have an anonymous session in the sessions table.
* One way to achieve this is to go to the update.php page.
*
* Usage: php d7-autologin.php http://example.com 127.0.0.1
*
@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc