Skip to content

Instantly share code, notes, and snippets.

pushd()
{
if [ $# -eq 0 ]; then
DIR="${HOME}"
else
DIR="$1"
fi
builtin pushd "${DIR}" > /dev/null
ls -al
<?php /* Only show excerpts for Standard post format OR Chat format,
when this is not both the very first standard post and also a Sticky post AND
when excerpts enabled or One-Sentence Excerpts enabled AND
this is not the very first standard post when Show Full Content First Post enabled */
?>
<?php if ( ( ! get_post_format() || 'chat' === get_post_format() ) &&
( ! ( independent_publisher_is_very_first_standard_post() && is_sticky() ) ) &&
( independent_publisher_use_post_excerpts() || independent_publisher_generate_one_sentence_excerpts() ) &&
( ! ( independent_publisher_show_full_content_first_post() && independent_publisher_is_very_first_standard_post() && is_home() ) )
) :
/* Install the Jetpack Custom CSS module, then go Appearance→Edit CSS and add this: */
.sml_emailinput {
width: 80%;
}
/* If that doesn't work, try adding !important like this: */
.sml_emailinput {
width: 80% !important;
}
FileETag none
<IfModule mod_headers.c>
Header unset etag
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/plain "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
@raamdev
raamdev / get.dev.sh
Last active November 2, 2015 08:21
Wildcard domains for development (*.dev) made simple, now with MacPorts support. See http://dev.sh for the original script.
#!/bin/sh
set -o errexit
set -e
# Fail fast if we're not on OS X >= 10.6.0.
if [ "$(uname -s)" != "Darwin" ]; then
echo "Sorry, DevDNS requires Mac OS X to run." >&2
exit 1
@raamdev
raamdev / nginx-mamp-macports.txt
Last active February 24, 2023 08:02
These are the steps to get Nginx running alongside MAMP on a Mac.
# These steps will get nginx installed on your Mac for local development and
# testing purposes, to be used alongside MAMP (which already includes Apache).
# The following steps assume that you're running MAMP and that you already
# have php-cgi in /Applications/MAMP/bin/php/php5.4.10/bin/php-cgi.
# The start-nginx and stop-nginx scripts created at the end do not
# start or stop MySQL because it is assumed that you normally run MAMP
# with Apache + MySQL turned on and that you occasionally want to switch
# your web server to Nginx for testing purposes and that you leave MySQL running.
# This process was tested successfully on OS X 10.9.
# Download & install marports http://www.macports.org/install.php
$ sudo port selfupdate
$ sudo port install nginx
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
$ sudo port install php5 +fastcgi fcgi
$ sudo mkdir /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ cd /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ mate org.macports.php-fastcgi.plist # or vim org.macports.php-fastcgi.plist
<?php
/*
Plugin Name: Subscribe to Comments Reloaded
Version: 140125
Stable tag: 140125
Requires at least: 2.9.2
Tested up to: 3.8
Plugin URI: http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/
@raamdev
raamdev / add_filter_example.php
Created January 23, 2014 16:31
add_filter() example
<?php
add_filter( 'stcr_confirmation_email_message', 'modify_email_message', 10, 3 );
function modify_email_message( $message, $_post_ID, $email ) {
$message = $message . "Adding something to the end of my email confirmation message.";
return $message;
}