Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View binaryreverse's full-sized avatar

Chris binaryreverse

View GitHub Profile
@binaryreverse
binaryreverse / xdebug_disable_limits.php
Last active April 21, 2020 17:32
Disable Xdebug var_dump limitations
<?php
ini_set('xdebug.var_display_max_depth', -1);
ini_set('xdebug.var_display_max_children', -1);
ini_set('xdebug.var_display_max_data', -1);
?>
@binaryreverse
binaryreverse / curl_fetch_url_content.php
Last active April 21, 2020 17:31
PHP fetch content from URL alternative with curl (instead of file_get_contents)
<?php
$url = 'http://xxxxxxxxxx.tld';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);
?>
@binaryreverse
binaryreverse / data_attribute_checker.js
Last active June 13, 2016 12:34
Check each element in a nested structure (like a slider) for a specific data attribute and mark these elements visually witha red background (Q&D)
$('.my-outer-container').find('.my-element').each(function() {
if(typeof $(this).data('my-datakey') === 'undefined') {
$(this).css('background', '#FF0000');
}
});
@binaryreverse
binaryreverse / get_unix_ts_seconds.bash
Created May 31, 2016 09:33
Get Unix timestamp in seconds since Unix epoch
date +%s
@binaryreverse
binaryreverse / empty_zend_cache.bash
Last active May 24, 2016 12:21
Empty local Zend cache
sudo rm -rf /var/www/html/portale/data/cache/pages/*
sudo rm -rf /var/www/html/portale/data/cache/metadata/*
@binaryreverse
binaryreverse / mysql_shell_import.bash
Last active May 24, 2016 12:21
MySQL shell import
mysql -u <user> -p -h <host> <db_name> < mydump.sql
@binaryreverse
binaryreverse / rpm_package_changelog.bash
Last active May 24, 2016 12:21
Get changelog info to installed package (RPM based distro)
rpm -q --changelog <packagename> | less
@binaryreverse
binaryreverse / mysql_shell_login.bash
Last active May 24, 2016 12:20
MYSQL shell login
mysql -u <username> -p -h <host>
@binaryreverse
binaryreverse / vbox_kernel_module_compile.bash
Last active May 24, 2016 12:20
(Re)compile VirtualBox kernel module
sudo /usr/lib/virtualbox/vboxdrv.sh setup
@binaryreverse
binaryreverse / list_processes_and_grep.bash
Last active May 24, 2016 12:20
List processes and grep through
ps -aux | grep <search-term>