Skip to content

Instantly share code, notes, and snippets.

Svetoslav Marinov lordspace

Block or report user

Report or block lordspace

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bappi-d-great
bappi-d-great / code.php
Created Aug 11, 2015
Remove role and assign subscriber role to the user or membership cancel
View code.php
<?php
add_action( 'ms_model_event', 'my_event_handler', 10, 2 );
/**
* Handles an event and process the correct communication if required.
*
* @param MS_Model_Event $event The event that is processed.
* @param mixed $data The data passed to the event handler.
*/
@renarsvilnis
renarsvilnis / server-setup-guide-warp.md
Last active May 26, 2017
Guide for configuring server for apache, php, ssh etc..
View server-setup-guide-warp.md

DEV SERVER SETUP


A reference for setting up Linux/Ubuntu server for LAMP, Node.js laboratory.

May be helpful for others, hence this git. If it contains errors, please push them.

This assumes

@codeablehq
codeablehq / backup.sh
Last active Jul 3, 2017
A script that creates a backup of your WordPress site and uploads it to Dropbox
View backup.sh
#!/bin/bash
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh
# make it executable: chmod +x /usr/local/sbin/backup.sh
# then add it to cron: crontab -e
# and add the line below, which will run backup 3am each day, then upload to Dropbox
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1
# You also need WP CLI installed: http://wp-cli.org/
@Xeoncross
Xeoncross / record.php
Last active Dec 15, 2015
Record audio from flash to MP3 using PHP
View record.php
<?php
// https://code.google.com/p/wami-recorder/
# Save the audio to a URL-accessible directory for playback.
parse_str($_SERVER['QUERY_STRING'], $params);
$name = isset($params['name']) ? $params['name'] : 'output.wav';
$content = file_get_contents('php://input');
$fh = fopen($name, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);
@jchristopher
jchristopher / class-iti-cap-limiter.php
Created Mar 7, 2012
[WordPress] Prevents the creation of full Administrators by client accounts
View class-iti-cap-limiter.php
<?php
/**
* Prevents the creation of full Administrators by client accounts
* Forked from JPB_User_Caps (unable to locate origin)
*
* @return void
* @author Jonathan Christopher
*/
if( is_admin() )
@johnpbloch
johnpbloch / disable-plugins-when-doing-local-dev.php
Created Feb 11, 2012 — forked from markjaquith/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
View disable-plugins-when-doing-local-dev.php
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@hakre
hakre / dl-file.php
Created Jan 2, 2012
Wordpress login to download uploaded files
View dl-file.php
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@mastergizmo
mastergizmo / jq-mobile-green-button-theme.css
Created Aug 5, 2011 — forked from irohiroki/gist:909284
jQuery Mobile Green Theme for Buttons
View jq-mobile-green-button-theme.css
.ui-btn-up-g, .ui-btn-hover-g, .ui-btn-down-g
{
color: white;
font-weight: bold;
text-decoration: none;
}
.ui-btn-up-g
{
border: 1px solid #397114;
You can’t perform that action at this time.