most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
################################################################################# | |
# Import modules | |
################################################################################# | |
import os | |
import time | |
import sys | |
import socket | |
import string |
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
<?php | |
/** | |
* Duplicate this file as many times as you would like, just be sure to change the | |
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com | |
* | |
* Plugin Name: Empty Widget | |
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs. | |
* Author: RedRokk Interactive Media | |
* Version: 1.0.0 | |
* Author URI: http://www.redrokk.com |
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
<?php | |
/* | |
Usage: | |
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
if ( !$frag->output() ) { // NOTE, testing for a return of false | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
// IMPORTANT | |
$frag->store(); | |
// YOU CANNOT FORGET THIS. If you do, the site will break. |
This will be a copy/paste doc for installing redis, elasticsearch and logstash on ubuntu 12.04
apt-get update
apt-get upgrade
apt-get install tcl8.5 tcl8.5-dev build-essential rubygems git \
htop python-dev openjdk-7-jre-headless libcurl4-openssl-dev \
bison ctags flex gperf libevent-dev libpcre3-dev libssl-dev libreadline6-dev \
libtokyocabinet-dev libncursesw5-dev libxml2-dev libxslt1-dev libsqlite3-dev \
<?php | |
/* | |
Enviar e-mail para o administrador se houver posts para revisão | |
Dicas do @GugaAlves (@tudoparawp): | |
- Adicionar link para enviar e-mail diretamente para o administrador; | |
- Incluir link para a edição do post no admin, facilitando a vida do admin que receber este email. | |
Dicas do Gustavo Bordoni (@webord): | |
- incluir na função o $post (objeto para WP_Query) para não ficar passando o $post_id a cada save; |
<?php | |
$certificateCAcer = '/certificate.cer'; | |
$certificateCAcerContent = file_get_contents($certificateCAcer); | |
/* Convert .cer to .pem, cURL uses .pem */ | |
$certificateCApemContent = '-----BEGIN CERTIFICATE-----'.PHP_EOL | |
.chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL) | |
.'-----END CERTIFICATE-----'.PHP_EOL; |
#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.
Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.