Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
working ...

Dimas Begunoff farinspace

🙃
working ...
View GitHub Profile
@mangoliou
mangoliou / x11vnc-stack-smashing-detected-solution.mk
Last active Sep 18, 2020
x11vnc `stack smashing detected` solution.
View x11vnc-stack-smashing-detected-solution.mk
# Install x-related to compile x11vnc from source code.
sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
# Grep source code.
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active Oct 10, 2020
All those damned wp-config constants you can never remember.
View wp-config.php
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@scribu
scribu / router.php
Created Nov 16, 2012 — forked from tamagokun/router.php
Run a Wordpress site via PHP's built-in web server
View router.php
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
chdir( $root );
$path = '/'.ltrim( parse_url( $_SERVER['REQUEST_URI'] )['path'],'/' );
if ( file_exists( $root.$path ) )
{
if ( is_dir( $root.$path ) && substr( $path,strlen( $path ) - 1, 1 ) !== '/' )
{
@petenelson
petenelson / admin_head_post_edit_check.php
Created Nov 1, 2012
WordPress admin action hooks for listing/adding/editing posts or pages
View admin_head_post_edit_check.php
/* actions fired when listing/adding/editing posts or pages */
/* admin_head-(hookname) */
add_action( 'admin_head-post.php', 'admin_head_post_editing' );
add_action( 'admin_head-post-new.php', 'admin_head_post_new' );
add_action( 'admin_head-edit.php', 'admin_head_post_listing' );
function admin_head_post_editing() {
echo 'you are editing a post';
}
@farinspace
farinspace / is_array.js
Created Nov 23, 2011
Javascript function to check if obj is an array
View is_array.js
function isArray( obj )
{
if ( Object.prototype.toString.call( obj ) === '[object Array]' ) return true;
return false;
}
@farinspace
farinspace / bbpress-hooks.php
Created Nov 17, 2011
Generate a list of hooks and filters for bbpress 2.0.1
View bbpress-hooks.php
<?php
// place and run in ./plugins/bbpress/bbp-themes
$dirs = array( './bbp-twentyten', './bbp-twentyten/bbpress' );
$actions = array();
$filters = array();
@farinspace
farinspace / gif.php
Created Oct 9, 2011
PHP function to write a blank 1px gif
View gif.php
function writeGif()
{
header( 'Content-type: image/gif' );
header( 'Expires: Wed, 11 Nov 1998 11:11:11 GMT' );
header( 'Cache-Control: no-cache' );
header( 'Cache-Control: must-revalidate' );
@farinspace
farinspace / combos.php
Last active Dec 28, 2019
Recursive functions, I can never find exactly what I need in a pinch
View combos.php
<?php
function combos($data, &$all = array(), $group = array(), $val = null, $i = 0) {
if (isset($val)) {
array_push($group, $val);
}
if ($i >= count($data)) {
array_push($all, $group);
} else {
foreach ($data[$i] as $v) {
You can’t perform that action at this time.