Skip to content

Instantly share code, notes, and snippets.

View mauryaratan's full-sized avatar
🦌

Ram Ratan Maurya mauryaratan

🦌
View GitHub Profile
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN

Hello,

Many times, we see smaller sized droplets run out of memory due to the number of processes that are running. This can cause slow connections, services to crash and overall unpredictable behavior.

Potential solutions are:

  1. Upsize to a larger server. We recommend at least a 1GB droplet for any server utilizing a MySQL database.

  2. Enable swap (search for 'swap' in our articles https://digitalocean.com/community)

@westonruter
westonruter / git-props-shortlog-wordpress.sh
Last active December 20, 2015 13:09
Gather up the WordPress core contributor props in the git-shortlog -sn format. NOTE: THIS CURRENTLY DOES NOT SUPPORT MULTIPLE PROPS!
# git clone git@github.com:WordPress/WordPress.git .
# TODO: Add support for props that list multiple people
git log -i --grep props | egrep -io 'props (to )?[a-z0-9_\-]*' | sed 's/.* //' | sort | uniq -c | sort -k1nr
@chuckreynolds
chuckreynolds / permissions.sh
Created April 24, 2014 10:46
permissions.sh shell script for WordPress installs to set file and directory permissions and ownership. Change the path to fit your install. Make sure to 'chmod 700 permissions.sh' before using './permissions.sh' to run it.
#!/bin/bash
find /var/www/public -type d -exec chmod 755 {} +
find /var/www/public -type f -exec chmod 644 {} +
chown -R www-data:www-data /var/www/public
@westonruter
westonruter / customize-readonly.js
Last active August 9, 2016 19:23
Customize Readonly WordPress Plugin: Only let superadmins make changes in the Customizer. All other admins can just preview changes. For them, the save UI is removed/disabled, and the Ajax request to save settings is blocked. The customize_readonly filter can be used to fine-tune which users are read-only.
/*global wp, jQuery */
wp.customize.ReadOnly = ( function ( $, api ) {
var self;
self = {};
self.init = function () {
// Hide the save button
$( '#save' ).hide();
/**
* plugin.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
@morganestes
morganestes / wp-beta-setup.sh
Last active May 15, 2017 07:56
Set up a WordPress site for beta testing with wp-cli.
#!/usr/bin/env sh
# Install the Beta Tester plugin and set it to "Bleeding Edge" releases.
# Note: after installing plugin and setting the option, you may need to visit
# the site once before updating core version.
wp-beta() {
wp plugin install wordpress-beta-tester --activate
wp option set wp_beta_tester_stream unstable
wp core update
@mauryaratan
mauryaratan / stagtools.txt
Last active August 14, 2017 07:51
StagTools WordPress Plugin's list of all available shortcodes, just in case you want to use theme manually instead of shortcode builder.
Alerts
======
[stag_alert style="white"]Your Alert![/stag_alert]
Styles: white, grey, red, yellow, green, blue
Buttons
=======
@edenthecat
edenthecat / holler.md
Last active February 9, 2018 18:05
Alert me when a process is complete

Install terminal-notifier via homebrew: https://github.com/julienXX/terminal-notifier

If using zsh, create an alias: alias -g holler="echo 'holler' | terminal-notifier -sound default"

Store it in ./zshrc if you're happy with it!

Now you can run bundle exec rspec ; holler and it will make a notification that says "holler" when your tests are done.

@aaronbarker
aaronbarker / CSS Variables Polyfill.markdown
Last active February 23, 2018 16:51
CSS Variables Polyfill